[OpenLayers-Users] WMS and Google Maps - Overlayer Alignement

Christopher Schmidt crschmidt at metacarta.com
Tue Aug 26 10:46:31 EDT 2008


On Tue, Aug 26, 2008 at 06:45:03AM -0700, Salvaro wrote:
> 
> I found a part of the generated JS, but it looks like useless:
> "mapOptions_0 = (mapOptions = $MapOptions(new MapOptions()) ,
> mapOptions.element['maxResolution'] = 156543.03125 , maxExtent = $Bounds(new
> Bounds(), -20037508, -20037508, 20037508, 2.003750834E7) ,
> mapOptions.element['controls'] = $JObjectArray_0(new JObjectArray(),
> initValues(_3Lcom_google_gwt_core_client_JavaScriptObject_2_classlit, 1184,
> -1, [])).element , mapOptions.element['restrictedExtent'] =
> maxExtent.element , mapOptions.element['numZoomLevels'] = 19 ,
> mapOptions.element['projection'] = 'EPSG:900913' ,
> $setAttribute_0(mapOptions, 'displayProjection', WSG84.element) ,
> mapOptions.element['units'] = 'km' , mapOptions); "
> 
> But I found something "new", when I put the zoom in the maximun is possible
> to change the position of Map in some metres (kilometres after I changed the
> units), so, I guess the problem probably should be in the coordinates passed
> when the map is with Spherical Mercator true (probably is passing anything
> like 0.00023 in the place of 23.000), I find for something in the source of
> the lib but if I change the value of coordinates direct in Navigation.js it
> will not work in WMS. Is possible do something to pass the correct
> coordinates to move the map? Is anything wrong in the code?

Er, it sounds like maybe you're saying "I set the center coordinates
using latitude and longitude, and the map moves by a very small amount."

Since your map is mercator projected, you'll need to Set your center
coordinates in the mercator projection. OpenLayers Javascript has the
ability to reproject by using LonLat.transform(from, to); I don't know
if GWT exposes this functionality.

Again, attaching or publishing a full HTML page demonstrating the
problem might help here, even with the Javascript being unusable.

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list