Is there a way to add a tile layer?

Jun 4, 2009 at 2:27 PM

The javascript VE control has a method named AddTileLayer() which takes a VETileSourceSpecification. Does this WPF control have something similar?

Jun 4, 2009 at 3:26 PM

I think I've got this figured out or at least am on the right track. I need to call globeControl.Host.DataSources.Add() and point it to a custom manifest XML file which I host. That manifest XML will then tell VE how to request the image tiles of my layer from my custom tile server.

For example, this manifest XML http://www.bing.com/maps/Manifests/RT.xml instructs VE how to request the road tiles from the Microsoft public tile server.

 

 

 

Coordinator
Jun 4, 2009 at 3:33 PM

This control makes no attempt to duplicate the javascript API.

There is a VEMap.AddShape() which is generally unfinished.  It only supports polylines.

Release 2 will have more support for that and WMS layers, etc.

You are on the right track for adding data sources, though.

Jul 9, 2009 at 5:57 PM

So could I use the globeControl.Host.DataSources.Add() method along with a custom xml file in order to display tiles from a wms server or would I need to add some new code in order to display the wms data correctly?  I've played around a little using ConnectionParameters and the DataSources.Add method, but it seems that some calculations need to be done in order get the data to display properly.  For example, I tried using ConnectionParameters to request a single image from a server and it ended up being tiled over the whole map.

Coordinator
Jul 9, 2009 at 10:11 PM

rjohnson06, not quite sure what you did to tile one image across the whole map, but if you set up your xml file and WMS server right, it should just tile the extent of the WMS.

As an example, look at the xml files that Bing Maps uses.  Check this post for latest urls:

http://blogs.msdn.com/virtualearth3d/archive/2009/04/06/data-format-revision.aspx

This blog also has more about data sources:

http://blogs.msdn.com/virtualearth3d/archive/2009/06/09/wms-data.aspx

Jul 20, 2009 at 2:38 PM
Edited Jul 20, 2009 at 2:39 PM

Thanks for the help, I figured out what was wrong, I was manually placing the bounding box values into the ConnectionParameters rather than parameters which VE3D could then request based on which tile it was currently texturing.  I'm not sure if anyone has run into this before but, using the code found in this link: http://blogs.msdn.com/virtualearth3d/archive/2009/06/09/wms-data.aspx, I added tile layers to the virtual earth and observed some strange behavior.  I have an interface which lets me to select which layers to add individually.  I can add one layer correctly, but when I add a second, they both disappear and when I add a third, all three of the layers appear again.  I'm pretty sure I ruled out my code as the cause of this, does anyone know why this might be happening? Note: I fixed the behavior by removing and adding all the layers in one request every time a layer is added, I'm just curious as to why it was happening.

Coordinator
Jul 21, 2009 at 1:55 AM

That's odd.  I haven't heard of that behavior, but it sounds like you found a work-around.

Jul 30, 2009 at 9:23 AM

Hello All!

 

I'm actually working on a research projet where I need to display some WMS data from a GeoServer into a WPF control.

I saw in your roadmap that you plan to handle WMS layers in the next release of VEMap and I wanted ot know if you have more information about the release date, or if any beta version would be available ?

Another way would be to go on the current release like it seems rjohnson06 did, and I wanted to know if anyone would have some sample code of using ConnectionParameters with a wms server ?

 

Thanks

 

Sebastien

Coordinator
Jul 30, 2009 at 8:22 PM

SebMeunier,

I won't have an ETA on the next version.  It depends upon a lot of factors I don't have control over.

For adding it yourself, take a look at all the various links in this thread.  There may be some other threads with additional information if you search the discussion group.  The hardest part is getting the WMS server set up properly, but there should be references on the web for that.  Once your WMS server is set up, you just have to add the data connection properly and it will magically work.

Aug 6, 2009 at 9:23 PM

 

ConnectionParameters p = new
                ConnectionParameters("http://www.lifemapper.org/Services/WMS/?ScientificName=Ursus%20americanus&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&LAYERS=Species Distribution Models,Political Boundaries,Species Data Points&STYLES=&SRS=EPSG:4326&BBOX={16},{17},{18},{19}&WIDTH=256&HEIGHT=256&FORMAT=image/png&TRANSPARENT=TRUE&EXCEPTIONS=application/vnd.ogc.se_inimage&");
            //SingleImageDataSource theSource = new SingleImageDataSource(new Bitmap(@"/Resources/hazards.png"), new LatLon(-90, -180), new LatLon(90, 180));
            
            System.Console.WriteLine("http://map.ngdc.noaa.gov/wmsconnector/com.esri.wms.Esrimap/hazards?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&LAYERS=nos_coops&STYLES=&SRS=EPSG:4326&BBOX={16},{17},{18},{19}&WIDTH=256&HEIGHT=256&FORMAT=image/png&TRANSPARENT=TRUE&EXCEPTIONS=application/vnd.ogc.se_inimage&");
            p.CoordinateReferenceSystem = Microsoft.MapPoint.CoordinateSystems.Wgs84CoordinateReferenceSystem.Instance;
            TheRadialMenu.Child.GlobeControl.Host.DataSources.Add(new DataSourceLayerData("nos_coops", "nos_coops", p.ToString(), DataSourceUsage.TextureMap));
In case you were still looking, the code below will add a layer to the globe.  
ConnectionParameters p = new
                ConnectionParameters("ServerUrl");
           
            p.CoordinateReferenceSystem = Microsoft.MapPoint.CoordinateSystems.Wgs84CoordinateReferenceSystem.Instance;
            map.GlobeControl.Host.DataSources.Add(new DataSourceLayerData("some", "layer", p.ToString(), DataSourceUsage.TextureMap));