|
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?
|