parseFloat() for lat/lng pairs, because many beginner level programmers pass as string.
MODIFY
www/Circle.js
www/Circle.js
@@ -17,6 +17,8 @@ var Circle = function (map, circleOptions, _exec) {
//-----------------------------------------------
self.on("center_changed", function () {
var center = self.get("center");
+ center.lat = parseFloat(center.lat, 10);
+ center.lng = parseFloat(center.lng, 10);
self.exec.call(self, null, self.errorHandler, self.getPluginName(), 'setCenter', [self.getId(), center.lat, center.lng]);
});
self.on("fillColor_changed", function () {
@@ -74,6 +76,8 @@ Circle.prototype.getClickable = function () {
return this.get('clickable');
};
Circle.prototype.setCenter = function (center) {
+ center.lat = parseFloat(center.lat, 10);
+ center.lng = parseFloat(center.lng, 10);
this.set('center', center);
return this;
};

MODIFY
www/Common.js
www/Common.js
@@ -543,8 +543,8 @@ function createMvcArray(array) {
function getLatLng(target) {
return "getPosition" in target ? target.getPosition() : {
- "lat": target.lat,
- "lng": target.lng
+ "lat": parseFloat(target.lat, 10),
+ "lng": parseFloat(target.lng, 10)
};
}
function convertToPositionArray(array) {

MODIFY
www/GroundOverlay.js
www/GroundOverlay.js
@@ -70,8 +70,8 @@ GroundOverlay.prototype.setBounds = function (points) {
bounds = [];
for (i = 0; i < points.length; i++) {
bounds.push({
- "lat": points[i].lat,
- "lng": points[i].lng
+ "lat": parseFloat(points[i].lat, 10),
+ "lng": parseFloat(points[i].lng, 10)
});
}
this.set('bounds', bounds);

MODIFY
www/Marker.js
www/Marker.js
@@ -15,6 +15,8 @@ var Marker = function(map, markerOptions, _exec, extras) {
var self = this;
if (markerOptions && markerOptions.position) {
+ markerOptions.position.lat = parseFloat(markerOptions.position.lat);
+ markerOptions.position.lng = parseFloat(markerOptions.position.lng);
self.set('position', markerOptions.position);
}
@@ -27,6 +29,8 @@ var Marker = function(map, markerOptions, _exec, extras) {
self.on("position_changed", function() {
var position = self.get("position");
+ position.lat = parseFloat(position.lat, 10);
+ position.lng = parseFloat(position.lng, 10);
self.exec.call(self, null, self.errorHandler, self.getPluginName(), 'setPosition', [self.getId(), position.lat, position.lng]);
});
self.on("rotation_changed", function() {

parseFloat() for lat/lng pairs, because many beginner level programmers pass as string.