[OpenLayers-Users] Defining zoom levels with Google Maps

kaka drspencer at hotmail.com
Thu Jul 5 04:02:11 EDT 2007


Thank you Glen, this seems to be working. I used

var map = new OpenLayers.Map('map', {controls: [new
OpenLayers.Control.PanZoomBar()], numZoomLevels: 3});
var GMapsSat = new OpenLayers.Layer.Google( "Google Satellite" , {type:
G_SATELLITE_MAP, MIN_ZOOM_LEVEL: 6, MAX_ZOOM_LEVEL: 8} );

However, this also seems to cause a new problem: the GML layer is no longer
being drawn and I am not sure why this is the case. See
http://www.villageografica.com/test50/zoomLevels3.html for a demo.

Regards,

Magnus



Glen Stampoultzis-2 wrote:
> 
> Just had a bit of a play and got it working.  Here's what I did:
> 
> map = new OpenLayers.Map( 'map' , { controls: [new
> OpenLayers.Control.MouseDefaults()] , 'numZoomLevels':3});
> var satellite = new OpenLayers.Layer.Google( "Google Satellite" , {type:
> G_SATELLITE_MAP, MIN_ZOOM_LEVEL: 10, MAX_ZOOM_LEVEL: 13 } );
> map.addLayers([satellite]);
> 
> You'll probably want to choose different MIN and MAX values but this seems
> to work for me.
> 
> On 05/07/07, kaka <drspencer at hotmail.com> wrote:
>>
>>
>> I have tried using maxZoomLevel etc. but to my understanding, this only
>> decides if the layer should be drawn or not, and it does not actually
>> define
>> the resolutions used. Is this correct? Also, I found some google maps
>> resolutions over at
>> http://dev.openlayers.org/docs/overview-summary-Google.js.html , but I am
>> not sure of how to insert them (3, to be exact) in my example. Any
>> suggestions? Many thanks for your rapid reply.
>>
>> Magnus
>>
>>
>>
>> Glen Stampoultzis-2 wrote:
>> >
>> > Well the resolutions are defined in an array called RESOLUTIONS in
>> > google.js.
>> > I'm guessing you could start by looking at altering that and/or
>> > MIN_ZOOM_LEVEL, MAX_ZOOM_LEVEL.
>> >
>> > On 05/07/07, kaka <drspencer at hotmail.com> wrote:
>> >>
>> >>
>> >> Hi
>> >> I am trying to create a map with only three zoom levels, using google
>> >> maps
>> >> as background. I have put up an example at
>> >> http://www.villageografica.com/test50/zoomLevels.html . I would like
>> to
>> >> keep
>> >> the top three zoom levels and cut the lower six ones, but if I change
>> the
>> >> number of zoom levels from 9 to 3, the map will be far too zoomed out
>> on
>> >> first load, much more than intended,
>> >> http://www.villageografica.com/test50/zoomLevels2.html . Is there a
>> way
>> >> to
>> >> define exactly which ones to use?
>> >>
>> >> Magnus
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/Defining-zoom-levels-with-Google-Maps-tf4027046.html#a11439053
>> >> Sent from the OpenLayers Users mailing list archive at Nabble.com.
>> >>
>> >> _______________________________________________
>> >> Users mailing list
>> >> Users at openlayers.org
>> >> http://openlayers.org/mailman/listinfo/users
>> >>
>> >
>> > _______________________________________________
>> > Users mailing list
>> > Users at openlayers.org
>> > http://openlayers.org/mailman/listinfo/users
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Defining-zoom-levels-with-Google-Maps-tf4027046.html#a11439171
>> Sent from the OpenLayers Users mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> Users mailing list
>> Users at openlayers.org
>> http://openlayers.org/mailman/listinfo/users
>>
> 
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
> 
> 

-- 
View this message in context: http://www.nabble.com/Defining-zoom-levels-with-Google-Maps-tf4027046.html#a11442334
Sent from the OpenLayers Users mailing list archive at Nabble.com.




More information about the Users mailing list