Utilize TileLayerExtender from code

Last post 3/28/2010 5:04:51 PM by Chris Pietschmann. 1 replies. << Back to Web.Maps.VE v3.0 General
1/28/2010 4:09:03 PM
Friso

Utilize TileLayerExtender from code

I have a simple question.

When I try to use the TileLayerExtender from the codebehind in a WPF application, I cannot set the TargetControlID (string) because in the code behind I use the map as an object.

This is my code that I'm trying to run:

TileLayerExtender tle = new TileLayerExtender();

TileSourceSpecification tss = new TileSourceSpecification();

tss.ID = "SeattleTransit";

tss.TileSource = "http://jbhatia1.members.winisp.net/SeattleTransit/%4.png";

tss.NumServers = 1;

tss.MinZoom = 2;

tss.MaxZoom = 16;

tss.Opacity = .8;

tss.ZIndex = 100;

LatLongRectangle llr = new LatLongRectangle();

llr.TopLeftLatLong = new LatLong(49, -123);

llr.BottomLeftLatLong = new LatLong(47, -47);

List<LatLongRectangle> rectangles = new List<LatLongRectangle>();

rectangles.Add(llr);

tss.Bounds = rectangles;

tle.TileSources.Add(tss);

tle.TargetControlID = map;

The last row (above) contains the issue. How can I reference this object from code? Instead of a string?

Or is there another way to enable/display the layer on the map control?

 

3/28/2010 5:04:51 PM
Chris Pietschmann

Re:Utilize TileLayerExtender from code

Sorry, but Web.Maps.VE is an ASP.NET WebForms control, and can not be used within a WPF application.