Permalink
Browse files

Merge branch 'hotfix/0.2.2'

  • Loading branch information...
2 parents 1d4537a + 97c2019 commit 41bd72a8193a19e44e9d41fa5fc88c19ee5748f5 @bjornd committed May 19, 2012
View
@@ -1,5 +1,5 @@
#
-# jVectorMap version 0.2.1
+# jVectorMap version 0.2.2
#
# Copyright 2011-2012, Kirill Lebedev
# Licensed under the MIT license.
@@ -153,7 +153,7 @@ def convert(self, outputFile):
"width": self.width,
"height": insetHeight
})
- self.map.projection = {"type": 'miller', "centralMeridian": self.longtitude0}
+ self.map.projection = {"type": 'miller', "centralMeridian": float(self.longtitude0)}
open(outputFile, 'w').write( self.map.getJSCode() )
View
@@ -1,5 +1,5 @@
/**
- * jVectorMap version 0.2.1
+ * jVectorMap version 0.2.2
*
* Copyright 2011-2012, Kirill Lebedev
* Licensed under the MIT license.
@@ -718,15 +718,19 @@
y = (180 / Math.PI * (5 / 4) * Math.log(Math.tan(Math.PI / 4 + (4 / 5) * lat * Math.PI / 360))) / 360 * WorldMap.circumference;
inset = this.getInsetForPoint(x, y);
- bbox = inset.bbox;
+ if (inset) {
+ bbox = inset.bbox;
- x = (x - bbox[0].x) / (bbox[1].x - bbox[0].x) * inset.width * this.scale;
- y = (y - bbox[0].y) / (bbox[1].y - bbox[0].y) * inset.height * this.scale;
+ x = (x - bbox[0].x) / (bbox[1].x - bbox[0].x) * inset.width * this.scale;
+ y = (y - bbox[0].y) / (bbox[1].y - bbox[0].y) * inset.height * this.scale;
- return {
- x: x + this.transX*this.scale + inset.left*this.scale,
- y: y + this.transY*this.scale + inset.top*this.scale
- };
+ return {
+ x: x + this.transX*this.scale + inset.left*this.scale,
+ y: y + this.transY*this.scale + inset.top*this.scale
+ };
+ } else {
+ return {x: 0, y: 0};
+ }
},
getInsetForPoint: function(x, y){
@@ -740,6 +744,7 @@
return insets[i];
}
}
+ return false;
}
},

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -15,6 +15,7 @@
[0, 0],
[-48.51, 2.21],
[33.51, 151.12],
+ {latLng: [21.13, -175.2], name: 'Tonga'},
{latLng: [-1.3, 103.8], name: 'Singapore'},
{latLng: [-22.2, 114.1], name: 'Hong Kong'}
]

0 comments on commit 41bd72a

Please sign in to comment.