Yes I now have two separate pages. The example URLs in my earlier message will be broken now.
That works but there are some bugs.
The base layer switching still doesn't work - having two pages is merely a work around.

I've also found a problem with Firefox (but not IE). My OpenLayer's div has a 100% width setting (in CSS). This works fine for the other layers, but the VE layer does not respect it and appears to use a default fixed setting. Overriding a fixed width for the div appears to work, but this doesn't fit with my site style/template very well!

And another issue is that only v3 & v4 are supported - both are being retired by Microsoft at the end of August. I've filed a ticket on this one.

For positive news, I've also sent a "how to" article to ViaVirtualEarth.

My maps are at:

http://www.ecomapcostarica.com/map/index.shtml
http://www.ecomapcostarica.com/map/index_ve.shtml


We hope to have some updates (map updates and student blogs) whilst we're out in the field from the 27th onwards.

Richard Marsden
Winwaed Software Technology LLC
http://www.winwaed.com
http://www.mapping-tools.com


getdano wrote:
I am experiencing the same behavior. The VE Layer works great by itself but
as soon as you select another base layer, selecting the VE layer does not
bring it back.
I don't believe this was a problem in the previous version of OpenLayers. In
fact, I replaced the 2.6 lib files with the 2.5 lib files and the base
layers example works fine with the older lib.
Is there some change that I have missed in the upgrade? Any advice would be
greatly appreciated.




Richard Marsden-119 wrote:
I am currently using MapServer and OpenLayers for an online mapping project to display a rain forest study area - unfortunately I'm a bit of a beginner with both! I'm currently having problems using Virtual Earth in OpenLayers: in particular switching between layers, and with VE versions.

Virtual Earth isn't suitable for the main map because our study area is only about 10ha of Costa Rican rain forest - ie. the detail just isn't there. However, I am try to use Virtual Earth as an optional base map to show the study area in context.

I've managed to get the OpenLayers Virtual Earth sample working with a MapServer WMS hydrology overlay ('synthetic streams').
I'm currently trying to get it to work with an alternative "outline map".

Ie. there are two base layers that can be chosen with a pair of radio buttons in the LayerSwitcher: 'Virtual Earth Base Layer', and 'Outline' (WMS delivered shape file) An optional overlay is selected with a checkbox: 'Synthetic streams' (also via WMS).

This is a work in progress so the colours could be improved, but my results are here:

http://www.ecomapcostarica.com/map/map_beta.html

Virtual Earth imagery loads okay at first. Switching to the 'Outline' works as well. However, when I switch back to Virtual Earth, it fails to re-appear. Instead, Outline is replaced with a white fill.

What am I doing wrong?  Or is this kind of behaviour not supported?

This is my Javascript:

<script
src="http://dev.virtualearth.net/mapcontrol/v3/mapcontrol.js";></script>

    <script src="./OpenLayers.js"></script>

    <script type="text/javascript">
        var lon = -84;
        var lat = 10;
        var zoom = 7;
        var map;
        var stream_layer, velayer, bound_layer, outline_layer;

        function init(){
            map = new OpenLayers.Map( 'map' );

            velayer = new OpenLayers.Layer.VirtualEarth("Virtual Earth
Base Layer", { minZoomLevel: 4, maxZoomLevel: 8, 'type': VEMapStyle.Aerial } );
            map.addLayer(velayer);


outline_layer = new OpenLayers.Layer.MapServer( "Outline", "http://www.ecomapcostarica.com/map/mapserv.cgi?map=/usr/home/winwaed/mapdata/cr_outline.map";,
{layers: 'outline'},
                    {gutter: 15});
            map.addLayer(outline_layer);

            stream_layer = new OpenLayers.Layer.MapServer( "Synthetic
Streams", "http://www.ecomapcostarica.com/map/mapserv.cgi?map=/usr/home/winwaed/mapdata/cr_stream.map";,
{layers: 'streams', transparent:'true'},
                    {gutter: 15});
            map.addLayer(stream_layer);



            map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
            map.addControl( new OpenLayers.Control.LayerSwitcher() );
        }
</script>


----

I've also tried changing the script to use v6.1 of the Virtual Earth Control, ie.:

<script src="http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.1";></script>

The results can be seen here:

http://www.ecomapcostarica.com/map/map_ve.html

The default "North America" map appears - not my selected area at all, and none of the OpenLayers controls (zoom, layer selection, etc) appear.

Is v3 the latest version supported by OpenLayers? Are there any plans to update this in the near future? I see that Microsoft are actively retiring old versions of the Virtual Earth API.

Thanks in advance. OpenLayers and MapServer are both capable of some pretty neat stuff - I have high hopes regarding the final result!


Richard Marsden
Wiwnaed Software Technology LLC
http://www.winwaed.com
http://www.mapping-tools.com







_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users



_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users

Reply via email to