Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fix region click event #78

Open
wants to merge 1 commit into from

2 participants

@LeGaS

No description provided.

@jantimon

Duplicate of issue #73

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 25, 2013
  1. @LeGaS

    Fix region click event

    LeGaS authored
This page is out of date. Refresh to see the latest.
Showing with 10 additions and 9 deletions.
  1. +10 −9 jqvmap/jquery.vmap.js
View
19 jqvmap/jquery.vmap.js
@@ -462,8 +462,9 @@
var path = e.target;
var code = e.target.id.split('_').pop();
+ var regionClickEvent = $.Event('regionClick.jqvmap');
- jQuery(params.container).trigger('regionClick.jqvmap', [code, mapData.pathes[code].name]);
+ jQuery(params.container).trigger(regionClickEvent, [code, mapData.pathes[code].name]);
if (!regionClickEvent.isDefaultPrevented()) {
if (map.selectedRegions.indexOf(code) !== -1) {
map.deselect(code, path);
@@ -481,12 +482,12 @@
if (map.label.is(':visible')) {
var left = e.pageX - 15 - map.labelWidth;
var top = e.pageY - 15 - map.labelHeight;
-
+
if(left < 0)
left = e.pageX + 15;
if(top < 0)
top = e.pageY + 15;
-
+
map.label.css({
left: left,
top: top
@@ -519,7 +520,7 @@
}
this.bindZoomButtons();
-
+
if(params.pins) {
/*if(params.pinMode) {
if(params.pinMode != "id" && params.pinMode != "content") {
@@ -791,7 +792,7 @@
map.zoomOut();
});
},
-
+
zoomIn: function () {
var map = this;
var sliderDelta = (jQuery('#zoom').innerHeight() - 6 * 2 - 15 * 2 - 3 * 2 - 7 - 6) / (this.zoomMaxStep - this.zoomCurStep);
@@ -807,11 +808,11 @@
map.zoomCurStep++;
jQuery('#zoomSlider').css('top', parseInt(jQuery('#zoomSlider').css('top'), 10) - sliderDelta);
-
+
map.container.trigger("zoomIn");
}
},
-
+
zoomOut: function () {
var map = this;
var sliderDelta = (jQuery('#zoom').innerHeight() - 6 * 2 - 15 * 2 - 3 * 2 - 7 - 6) / (this.zoomMaxStep - this.zoomCurStep);
@@ -827,7 +828,7 @@
map.zoomCurStep--;
jQuery('#zoomSlider').css('top', parseInt(jQuery('#zoomSlider').css('top'), 10) + sliderDelta);
-
+
map.container.trigger("zoomOut");
}
},
@@ -844,7 +845,7 @@
getPinId: function (cc) {
return this.getCountryId(cc)+'_pin';
},
-
+
placePins: function(pins, pinMode){
var map = this;
Something went wrong with that request. Please try again.