From fe66ca201499aa00d6f2c29537f48f298df5fc81 Mon Sep 17 00:00:00 2001 From: Kirill Lebedev Date: Thu, 31 May 2012 20:24:09 +0300 Subject: [PATCH] Fixed issue when markers were plotted with wrong latitude --- converter/converter.py | 2 +- jquery-jvectormap.js | 4 ++-- tests/markers-usa.html | 8 ++++---- tests/markers.html | 11 ++++++----- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/converter/converter.py b/converter/converter.py index a3aa4514..707d7a9d 100644 --- a/converter/converter.py +++ b/converter/converter.py @@ -1,5 +1,5 @@ # -# jVectorMap version 0.2.2 +# jVectorMap version 0.2.3 # # Copyright 2011-2012, Kirill Lebedev # Licensed under the MIT license. diff --git a/jquery-jvectormap.js b/jquery-jvectormap.js index 7965fbf0..e7e76313 100644 --- a/jquery-jvectormap.js +++ b/jquery-jvectormap.js @@ -1,5 +1,5 @@ /** - * jVectorMap version 0.2.2 + * jVectorMap version 0.2.3 * * Copyright 2011-2012, Kirill Lebedev * Licensed under the MIT license. @@ -715,7 +715,7 @@ } x = (lng - centralMeridian) / 360 * WorldMap.circumference, - y = (180 / Math.PI * (5 / 4) * Math.log(Math.tan(Math.PI / 4 + (4 / 5) * lat * Math.PI / 360))) / 360 * WorldMap.circumference; + 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); if (inset) { diff --git a/tests/markers-usa.html b/tests/markers-usa.html index 0de2786c..40e7e736 100644 --- a/tests/markers-usa.html +++ b/tests/markers-usa.html @@ -12,10 +12,10 @@ $('.map').vectorMap({ map: 'us_en', markers: [ - [-61.18, -149.53], - [-21.18, -157.49], - {latLng: [-40.39, -73.56], name: 'New York City', r: 8, fill: 'yellow'}, - {latLng: [-41.52, -87.37], fill: 'red', r: 10} + [61.18, -149.53], + [21.18, -157.49], + {latLng: [40.39, -73.56], name: 'New York City', r: 8, fill: 'yellow'}, + {latLng: [41.52, -87.37], fill: 'red', r: 10} ], onMarkerLabelShow: function(event, label, index){ console.log('label-show', label, index); diff --git a/tests/markers.html b/tests/markers.html index ed81fc0d..73f7ee12 100644 --- a/tests/markers.html +++ b/tests/markers.html @@ -13,11 +13,12 @@ map: 'world_en', markers: [ [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'} + [48.51, 2.21], + [-33.51, 151.12], + [64.623877,56.25], + {latLng: [-21.13, -175.2], name: 'Tonga'}, + {latLng: [1.3, 103.8], name: 'Singapore'}, + {latLng: [22.2, 114.1], name: 'Hong Kong'} ] }); });