javascriptjqueryjqvmap

How can I place a marker on each provinces of a country in jqvmap


This is my code:

HTML:

<div id="vmap" style="width: 400px; height: 400px;"></div>

JavaScript:

    jQuery(document).ready(function () {
        jQuery('#vmap').vectorMap({
            map: 'iran_ir',
            enableZoom: false,
            showTooltip: true,
            borderColor: '#FFF',
            hoverColor: '#1A3B4C',
            backgroundColor: '#add136',
            borderWidth: 3,
            borderColor: '#B0CE4A',
            borderOpacity: 1,
            color: '#112834',
            //pins: {},
            pinMode: 'content'
         });
     });

I think I should use pins property, but I don't know how to do that?!


Solution

  • Based on jqvmap documentation, there isn't any way for that.

    pins { "pk" : "pk_pin_metadata", "ru" : "ru_pin_metadata", ... }

    This option defines pins, which will be placed on the regions. The JSON can have only one element against one country code. Elements should be strings containing the HTML or id of the pin (depends on the 'pinMode' option explained next).

    I open an issue in GitHub for this feature.