[OpenLayers-Dev] overviewmap and spherical mercator

Steven M. Ottens steven at minst.net
Wed Sep 26 08:07:18 EDT 2007


Steven M. Ottens wrote:
> Hi All,
>
> I'm trying to implement an overviewmap together with a google layer, 
> using the spherical mercator code by Tim. However, it fails with an error:
> 'bounds has no properties' in the function zoomToExtent in Map.js
> This function is called from zoomToMaxExtent and it uses 
> this.getMaxExtent() to get a bounds. However this last function returns 
> null. this.maxExtent at this point is -180,-90,180,90 which I believe is 
> the default maxExtent, since it's wrong, tims foss4g sandbox only shows 
> North America and last time I checked that doesn't span the globe ;)
> If I go into getMaxExtent at this point it tells me that this.baseLayer 
> = null. At this point I don't know what to do. There is a baseLayer so I 
> don't understand why in the overviewMap it doesn't show. Or when that's 
> correct behavior, why it fails on a lack of bounds.
>
> Anyone has an overviewmap working with the Spherical Mercator 
> projection, if so could you please enlighten me?
>   
I've been trying some more and I do have an overviewmap, except it's 
showing the wrong extent:
I've added the overviewmap to google-sm.html this way:

  var options2 = {
                projection: "EPSG:900913",
                units: "m",
                layers: [google],
                maxExtent: new OpenLayers.Bounds(
               
                  -16710968, 391357,
                -4970241, 8218508)
    };
    var overview = new OpenLayers.Control.OverviewMap(options2);
       
    map.addControl(overview);

But the overviewmap shows a bit of the southern hemisphere in stead of 
the correct extent

regards,
Steven

> Regards,
> Steven
>
>
> _______________________________________________
> Dev mailing list
> Dev at openlayers.org
> http://openlayers.org/mailman/listinfo/dev
>   






More information about the Dev mailing list