PHP Classes

File: vendors/jqvmap/src/JQVMap/placePins.js

Recommend this page to a friend!
  Classes of Jorge Castro   Gentelella BladeOne   vendors/jqvmap/src/JQVMap/placePins.js   Download  
File: vendors/jqvmap/src/JQVMap/placePins.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Gentelella BladeOne
Render templates using Bootstrap for presentation
Author: By
Last change:
Date: 3 years ago
Size: 1,408 bytes
 

Contents

Class file image Download
JQVMap.prototype.placePins = function(pins, pinMode){ var map = this; if(!pinMode || (pinMode !== 'content' && pinMode !== 'id')) { pinMode = 'content'; } if(pinMode === 'content') {//treat pin as content jQuery.each(pins, function(index, pin){ if(jQuery('#' + map.getCountryId(index)).length === 0){ return; } var pinIndex = map.getPinId(index); var $pin = jQuery('#' + pinIndex); if($pin.length > 0){ $pin.remove(); } map.container.append('<div id="' + pinIndex + '" for="' + index + '" class="jqvmap-pin" style="position:absolute">' + pin + '</div>'); }); } else { //treat pin as id of an html content jQuery.each(pins, function(index, pin){ if(jQuery('#' + map.getCountryId(index)).length === 0){ return; } var pinIndex = map.getPinId(index); var $pin = jQuery('#' + pinIndex); if($pin.length > 0){ $pin.remove(); } map.container.append('<div id="' + pinIndex + '" for="' + index + '" class="jqvmap-pin" style="position:absolute"></div>'); $pin.append(jQuery('#' + pin)); }); } this.positionPins(); if(!this.pinHandlers){ this.pinHandlers = true; var positionFix = function(){ map.positionPins(); }; this.container.bind('zoomIn', positionFix) .bind('zoomOut', positionFix) .bind('drag', positionFix); } };