Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'release/1.2.2'

  • Loading branch information...
commit 0a0575b3de25a03d45689c1f369998fc37175531 2 parents 460e98c + 5006e8e
@bjornd authored
View
2  converter/converter.py
@@ -1,5 +1,5 @@
#
-# jVectorMap version 1.2.1
+# jVectorMap version 1.2.2
#
# Copyright 2011-2013, Kirill Lebedev
# Licensed under the MIT license.
View
2  jquery-jvectormap.js
@@ -1,5 +1,5 @@
/**
- * jVectorMap version 1.2.1
+ * jVectorMap version 1.2.2
*
* Copyright 2011-2013, Kirill Lebedev
* Licensed under the MIT license.
View
2  jvectormap.jquery.json
@@ -9,7 +9,7 @@
"usa",
"choropleth"
],
- "version": "1.2.1",
+ "version": "1.2.2",
"author": {
"name": "Kirill Lebedev",
"email" : "echo.bjornd@gmail.com"
View
14 lib/world-map.js
@@ -309,7 +309,10 @@ jvm.WorldMap.prototype = {
lastTouchesLength,
handleTouchEvent = function(e){
var touches = e.originalEvent.touches,
- scale;
+ offset,
+ scale,
+ transXOld,
+ transYOld;
if (e.type == 'touchstart') {
lastTouchesLength = 0;
@@ -317,11 +320,15 @@ jvm.WorldMap.prototype = {
if (touches.length == 1) {
if (lastTouchesLength == 1) {
+ transXOld = map.transX;
+ transYOld = map.transY;
map.transX -= (touchX - touches[0].pageX) / map.scale;
map.transY -= (touchY - touches[0].pageY) / map.scale;
map.applyTransform();
map.label.hide();
- e.preventDefault();
+ if (transXOld != map.transX || transYOld != map.transY) {
+ e.preventDefault();
+ }
}
touchX = touches[0].pageX;
touchY = touches[0].pageY;
@@ -339,6 +346,7 @@ jvm.WorldMap.prototype = {
map.label.hide();
e.preventDefault();
} else {
+ offset = jvm.$(map.container).offset();
if (touches[0].pageX > touches[1].pageX) {
centerTouchX = touches[1].pageX + (touches[0].pageX - touches[1].pageX) / 2;
} else {
@@ -349,6 +357,8 @@ jvm.WorldMap.prototype = {
} else {
centerTouchY = touches[0].pageY + (touches[1].pageY - touches[0].pageY) / 2;
}
+ centerTouchX -= offset.left;
+ centerTouchY -= offset.top;
touchStartScale = map.scale;
touchStartDistance = Math.sqrt(
Math.pow(touches[0].pageX - touches[1].pageX, 2) +
View
1  tests/index.html
@@ -253,6 +253,7 @@
</script>
</head>
<body>
+ <div style="height: 400px"></div>
<div id="map1" style="width: 600px; height: 400px"></div>
<button id="focus-single">Focus on Australia</button>
<button id="focus-multiple">Focus on Australia and Japan</button>
Please sign in to comment.
Something went wrong with that request. Please try again.