examples.vector.maps.js 601 B

12345678910111213141516171819202122232425262728293031
  1. (function( $ ) {
  2. 'use strict';
  3. var initMap = function( $el, options ) {
  4. var defaults = {
  5. backgroundColor: null,
  6. color: '#FFFFFF',
  7. hoverOpacity: 0.7,
  8. selectedColor: '#005599',
  9. enableZoom: true,
  10. borderWidth:1,
  11. showTooltip: true,
  12. values: sample_data,
  13. scaleColors: ['#1AA2E6', '#0088CC'],
  14. normalizeFunction: 'polynomial'
  15. };
  16. $el.vectorMap( $.extend( defaults, options ) );
  17. };
  18. $(function() {
  19. $( '[data-vector-map]' ).each(function() {
  20. var $this = $(this);
  21. initMap( $this, ($this.data( 'plugin-options' ) || {}) )
  22. });
  23. });
  24. }).apply( this, [ jQuery ]);