[OpenLayers-Users] Beginner Virtual Earth Problems
getdano
getmandj at ornl.gov
Wed May 14 14:24:14 EDT 2008
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
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>
>
--
View this message in context: http://www.nabble.com/Beginner-Virtual-Earth-Problems-tp17027774p17236190.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
More information about the Users
mailing list