Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pins position on resize #258

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 1 addition & 16 deletions src/JQVMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ var JQVMap = function (params) {
params = params || {};
var map = this;
var mapData = JQVMap.maps[params.map];
var mapPins;

if( !mapData){
throw new Error('Invalid "' + params.map + '" map parameter. Please make sure you have loaded this map file in your HTML.');
Expand Down Expand Up @@ -42,11 +41,7 @@ var JQVMap = function (params) {
var resizeEvent = jQuery.Event('resize.jqvmap');
jQuery(params.container).trigger(resizeEvent, [newWidth, newHeight]);

if(mapPins){
jQuery('.jqvmap-pin').remove();
map.pinHandlers = false;
map.placePins(mapPins.pins, mapPins.mode);
}
map.positionPins();
}
});

Expand Down Expand Up @@ -189,11 +184,6 @@ var JQVMap = function (params) {
this.bindZoomButtons();

if(params.pins) {
mapPins = {
pins: params.pins,
mode: params.pinMode
};

this.pinHandlers = false;
this.placePins(params.pins, params.pinMode);
}
Expand All @@ -210,11 +200,6 @@ var JQVMap = function (params) {
}
}

mapPins = {
pins: pins,
mode: 'content'
};

this.placePins(pins, 'content');
}

Expand Down