Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
unsatisfiableness
/
vendors
/
jqvmap
/
src
/
JQVMap
:
positionPins.js
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
JQVMap.prototype.positionPins = function(){ var map = this; var pins = this.container.find('.jqvmap-pin'); jQuery.each(pins, function(index, pinObj){ pinObj = jQuery(pinObj); var countryId = map.getCountryId(pinObj.attr('for').toLowerCase()); var countryObj = jQuery('#' + countryId); var bbox = document.getElementById(countryId).getBBox(); var position = countryObj.position(); var scale = map.scale; var left = position.left + (bbox.width / 2) * scale - pinObj.width() / 2, top = position.top + (bbox.height / 2) * scale - pinObj.height() / 2; pinObj.css('left', left).css('top', top); }); };