[OpenLayers-Users] maximum ZoomLevel for google maps

Christopher Schmidt crschmidt at metacarta.com
Thu Nov 27 17:49:29 EST 2008


On Thu, Nov 27, 2008 at 11:51:12AM -0800, Rodolfo Moreno wrote:
> 
> Thanks Arnd, It works very good.
> On the other hands, I have another question related with it.
> I am overlaying google maps with mapguide's layers. The problem is that the
> displaying scales are different.
>        Google maps		MAPGUIDE
> 	144000		100000
> 	 72000	 	 52000
> 	 36000		 27000
> 	 18000		 14000
> 	  9028		  7197
> 	  4514		  3728
> 	  2257		  1931
> 	  1129		  1000

... huh? Where are those scale values for MapGuide coming from? 

> Then the overlay of these two layers (google and mapguide) doesn't coincide.
> For example: The corner of the street1 and street2 in google layer is 200m
> toward the north of
> the that corner itself in mapguide layer. It happens due to that google
> layer is to the scale of 1:2257 and mapguide layer is to the scale of
> 1:1931.

I don't think I buy this. Perhaps this is some kind of spherical
mercator related difference: are you using spherical mercator?

> Is there any way that both layers have the same scales?
> 
> Regards
> 
> 
> Arnd Wippermann wrote:
> > 
> > Hi Rodolfo,
> > 
> > the patch from the old post is really not needed and there are only 21
> > zoomlevels for Wuppertal. 
> > 
> > Looking now at the question with a better understanding of OpenLayers, I
> > see, that I have only to set the numZoomLevels for the map object and
> > MAX_ZOOM_LEVEL for the Google layers. 
> > 
> > The default values are
> > 
> > MAX_ZOOM_LEVEL = 19
> > numZoomLevels  = 16
> > 
> > With the set
> > 
> > MAX_ZOOM_LEVEL = 21      (0 - 21 => 22 numZoomLevels)
> > numZoomLevels  = 21+1
> > 
> > i can get the result without any patch.
> > 
> > 
> > var maxZOOMLEVEL = 21;
> > 
> > map = new OpenLayers.Map('map',
> > { 
> >     maxExtent: new
> > OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34),
> >     numZoomLevels: maxZOOMLEVEL+1,
> >     maxResolution: 156543.0399,
> >     units: 'm',
> >     projection: new OpenLayers.Projection("EPSG:900913")
> > });
> > 
> > var gsat = new OpenLayers.Layer.Google(
> >     "Google Satellite",
> >     {type: G_SATELLITE_MAP, sphericalMercator : true, MAX_ZOOM_LEVEL :
> > maxZOOMLEVEL}
> > );
> > 
> > At http://gis.ibbeck.de/ginfo/ you can zoom up to 21 zoomlevels.
> > 
> > I hope, that helps.
> > 
> > Arnd Wippermann
> > 
> > _______________________________________________
> > Users mailing list
> > Users at openlayers.org
> > http://openlayers.org/mailman/listinfo/users
> > 
> > 
> 
> 
> -----
> Rodolfo Moreno
> CivilEng
> 
> -- 
> View this message in context: http://n2.nabble.com/maximum-ZoomLevel-for-google-maps-tp1574304p1586605.html
> Sent from the OpenLayers Users mailing list archive at Nabble.com.
> 
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users

-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list