codesite-noreply at google.com
2010-Jan-14 21:41 UTC
[Mapstraction] [mapstraction] r70 committed - Fixes issue 29....
Revision: 70 Author: dezfowler Date: Thu Jan 14 13:41:14 2010 Log: Fixes issue 29. - Fixed overrideApi issue where the api ID first argument isn''t removed before the call is passed on to the provider implementation - Added fromProprietary call to OpenLayers getCenter - Fixed Cloudmade getCenter implementation http://code.google.com/p/mapstraction/source/detail?r=70 Modified: /trunk/source/mxn.cloudmade.core.js /trunk/source/mxn.js /trunk/source/mxn.microsoft.core.js /trunk/source/mxn.openlayers.core.js ======================================--- /trunk/source/mxn.cloudmade.core.js Mon Dec 14 17:04:05 2009 +++ /trunk/source/mxn.cloudmade.core.js Thu Jan 14 13:41:14 2010 @@ -264,7 +264,8 @@ }, fromProprietary: function(point) { - return new mxn.LatLonPoint(point.lat(),point.lng()); + this.lat = point.lat(); + this.lon = point.lng(); } }, ======================================--- /trunk/source/mxn.js Mon Dec 14 17:04:05 2009 +++ /trunk/source/mxn.js Thu Jan 14 13:41:14 2010 @@ -244,19 +244,26 @@ */ this.go = function(sMethodName, args, oOptions){ + // make sure args is an array + args = Array.prototype.slice.apply(args); + if(typeof(oOptions) == ''undefined''){ oOptions = defOpts; } - var sApiId = oOptions.overrideApi ? args[0] : fnApiIdGetter.apply(obj); + var sApiId; + if(oOptions.overrideApi){ + sApiId = args.shift(); + } + else { + sApiId = fnApiIdGetter.apply(obj); + } if(typeof(sApiId) != ''string''){ throw ''API ID not available.''; } if(typeof(oOptions.context) != ''undefined'' && oOptions.context !== null){ - // make sure args is an array - args = Array.prototype.slice.apply(args); args.push(oOptions.context); } ======================================--- /trunk/source/mxn.microsoft.core.js Mon Dec 14 17:04:05 2009 +++ /trunk/source/mxn.microsoft.core.js Thu Jan 14 13:41:14 2010 @@ -143,7 +143,6 @@ var pl = polyline.toProprietary(this.api); pl.HideIcon();//hide the icon VE automatically displays map.AddShape(pl); - return pl; }, @@ -159,7 +158,6 @@ var LL = map.GetCenter(); var point = new mxn.LatLonPoint(LL.Latitude, LL.Longitude); return point; - }, setCenter: function(point, options) { @@ -302,8 +300,8 @@ }, fromProprietary: function(mpoint) { - this.lat =mpoint.Latitude; - this.lon =mpoint.Longitude; + this.lat = mpoint.Latitude; + this.lon = mpoint.Longitude; } }, ======================================--- /trunk/source/mxn.openlayers.core.js Mon Dec 14 17:04:05 2009 +++ /trunk/source/mxn.openlayers.core.js Thu Jan 14 13:41:14 2010 @@ -221,8 +221,10 @@ getCenter: function() { var map = this.maps[this.api]; - pt = map.getCenter(); - return new mxn.LatLonPoint(pt.lat, pt.lon); + var pt = map.getCenter(); + var mxnPt = new mxn.LatLonPoint(); + mxnPt.fromProprietary(this.api, pt); + return mxnPt; }, setCenter: function(point, options) {