Question

I am using jVectorMap library and its working fine. But i don't want to show country name when mouse hover over the map.

// worldMap is the container
  $('#worldMap').vectorMap({
                    map: 'world_mill_en',
                    backgroundColor : 'transparent',
                    zoomOnScroll: false,
                    zoomButtons : false
    });

Currently its showing country name when we hover over the map. I want do disable this functionality.

http://jsfiddle.net/3xZ28/238/

Any help is greatly appreciated.

Was it helpful?

Solution 2

http://jsfiddle.net/3xZ28/243/

onRegionLabelShow: function(e, el, code){
    e.preventDefault();
}

OTHER TIPS

Old post, but as of v2.0.3, the event, onRegionLabelShow, has been changed to onRegionTipShow. Same goes for onMarkerLabelShow = onMarkerTipShow

onRegionTipShow: function (e, label, code) {
    e.preventDefault();
}

After, taking help from @Mr.TK answer and further googling. I found the solution:

$('#worldMap').vectorMap({
     map: 'world_mill_en',
     backgroundColor: 'green',
     normalizeFunction: 'polynomial',
     zoomOnScroll: false,
     zoomButtons: false,
     regionStyle: {
         hover: {
             "fill-opacity": 1
         }
     },
     onRegionLabelShow: function (e, el, code) {
         e.preventDefault();
     },
     markers: [{
         latLng: [37.7833, -122.4167],
         name: 'San Francisco'
     }]
 });

This is what, i am looking for: http://jsfiddle.net/3xZ28/244/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top