Tuesday, 15 January 2013

jquery - how to mark or id a jvectormap -



jquery - how to mark or id a jvectormap -

how mark or identify jvectormap, can invoke alter in functions out of item? in case, have jvectormap , button(out of map), want happens when click button, jvectormap's "markersselectable" can changed true:

<!doctype html> <html> <head> <title>jvectormap demo</title> <link rel="stylesheet" href="jquery-jvectormap-1.0.css" type="text/css" media="screen"/> <script src="jquery.js"></script> <script src="jquery-jvectormap-1.0.min.js"></script> <script src="jquery-jvectormap-world-mill-en.js"></script> </head> <body> <form><input id="pan" type="button" value="pan" /></form> <div id="world-map" style="width: 600px; height: 400px"></div> <script> $(function(){ $('#world-map').vectormap( map: 'world_mill_en' ); $('#pan').click(function() { //change jvectormap attribute "markersselectable" true }); }); </script> </body> </html>

try empty element , reload new attribute. in experience works well.

<script> $(function(){ $('#world-map').vectormap( map: 'world_mill_en' ); $('#pan').click(function() { var map_object = $('#world-map').vectormap('get', 'mapobject'); map_object.params.markersselectable = false; }); }); </script>

btw, there's 1.2.2 version might want use.

jquery jvectormap

No comments:

Post a Comment