[OpenLayers-Users] Overview Map Question

Tim Schaub noreply at geocartic.com
Tue Jan 9 18:43:14 EST 2007


Ok, I think the bottom line is "no overview map with commercial layers"
unless someone sets me straight.
 
On the examples below, the first one gives me errors from maps.live.com
regardless of whether I add the overview map or not.  (And the space in the
MetaCarta URL makes this layer invalid - but that may be an email formatting
issue.)
 
If I get some time, I'll play with the overview map and the Google layers -
seems like they should work.  The VE layer creeps me out a bit.
 
Sorry there's not a better answer.
Tim
 


This shows no overviewmap control at all:

<html>
    <head>
        <title>Test</title>
        <style type="text/css">
            #map { 
                width: 512px; 
                height: 512px;
                border: 1px solid gray;
            }
        </style>
        <script src="
<http://dev.virtualearth.net/mapcontrol/v3/mapcontrol.js>
http://dev.virtualearth.net/mapcontrol/v3/mapcontrol.js "
type="text/javascript">< 
/script>
    <script src="  <http://www.openlayers.org/api/OpenLayers.js>
http://www.openlayers.org/api/OpenLayers.js"></script>
    </head>
    <body>
        <div id="map"></div>
        <script defer="defer" type="text/javascript">
            var map = new OpenLayers.Map('map'); 
        var virtualearth = new OpenLayers.Layer.VirtualEarth(
        "VirtualEarth");
            var metacarta = new OpenLayers.Layer.WMS(
                "Metacarta", 
                " http://labs.metacarta.com/wms/vmap0",
                {layers: 'basic'});
            map.addLayers([virtualearth,metacarta]);
            map.addControl (new OpenLayers.Control.OverviewMap());
            map.setCenter(new OpenLayers.LonLat(5.69, 50.85), 15);
        </script>
    </body>
</html>

This creates weird behaviour (1. overviewmap-control, but no overview-map.
2. mouse keeps dragging): 

<html>
    <head>
        <title>Test</title>
        <style type="text/css">
            #map {
                width: 512px;
                height: 512px; 
                border: 1px solid gray;
            }
        </style>
        <script src="
<http://dev.virtualearth.net/mapcontrol/v3/mapcontrol.js>
http://dev.virtualearth.net/mapcontrol/v3/mapcontrol.js "
type="text/javascript"></script>
    <script src="http://www.openlayers.org/api/OpenLayers.js
<http://www.openlayers.org/api/OpenLayers.js> "></script>
    <script src="
<http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAmbYSvchg-WUKZ1VciMUQeh
T2yXp_ZAY8_ufC3CFXhHIE1NvwkxTM_U0Wb-HnwWqFxi6YDlhfBryn8w>
http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAmbYSvchg-WUKZ1V
ciMUQehT2yXp_ZAY8_ufC3CFXhHIE1NvwkxTM_U0Wb-HnwWqFxi6YDlhfBryn8w "
type="text/javascript"></script>
    </head>
    <body>
        <div id="map"></div>
        <script defer="defer" type="text/javascript"> 
            var map = new OpenLayers.Map('map');
        var google = new OpenLayers.Layer.Google("Google Map");
    
            var metacarta = new OpenLayers.Layer.WMS(
                "Metacarta", 
                "http://labs.metacarta.com/wms/vmap0",
                {layers: 'basic'}); 
            map.addLayers([google,metacarta]);
            map.addControl(new OpenLayers.Control.OverviewMap());
            map.setCenter(new OpenLayers.LonLat(5.69, 50.85), 15);
        </script>
    </body>
</html>

As you can see, the problem is the baselayer. Whenever it isn't the(/a?) wms
layer, the overviewmap control breaks. Maybe the overviewmapcontrol should
default to the metacarta wms baselayer? 

I don't know much about the inside of the ol-api, I am just using the
excellent bricks you provide to build a php/mysql 'application' that
non-technical users can use and configure. Maybe I could do something back
by releasing the php-class when it is finished (if there isn't released one
already)? 

Robert,

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20070109/c62d628b/attachment.html


More information about the Users mailing list