James Thurley


Hi,

One (fairly major) aspect of my web application dynamically generates layers for a Virtual Earth map. With v4 I did this using the VETileSourceSpecification.GetTilePath property to create a custom url with extra parameters telling my tile server what data to render.

I've just moved over to VE v5, and this property is no longer mentioned in the API. I can't find any equivalent... have I missed a new alternative or has this functionality been removed

Thanks,

James.




Re: VETileSourceSpecification.GetTilePath - Gone in v5?

Stewart Collis


Same problem here. I have been trying to pass a javascript function through the constructor but have been unsucessful as yet.





Re: VETileSourceSpecification.GetTilePath - Gone in v5?

Derek Chan

Hello,

There's an undocumented property, VETileSourceSpecification.FnCallback which seems to be the VE5.0 equivalent. Can someone try to use this and see if it works

Along the same lines as above post, heres the code from the VE5.0 in terms of adding tiles:

var tileSourceSpec = new VETileSourceSpecification("lidar", "http://dev.live.com/virtualearth/sdk/layers/lidar/%4.png");
tileSourceSpec.NumServers = 1;
tileSourceSpec.Bounds = bounds;
tileSourceSpec.MinZoomLevel = 10;
tileSourceSpec.MaxZoomLevel = 16;
tileSourceSpec.Opacity = opacity;
tileSourceSpec.ZIndex = 100;

map.AddTileLayer(tileSourceSpec, true);
map.SetCenterAndZoom(new VELatLong(48.03,-122.4),12);

Regards,





Re: VETileSourceSpecification.GetTilePath - Gone in v5?

Stewart Collis

OK, looks like it is still there but just not documented. I got mine working by doing the following. I assume it is simply ignoring the 'GetTilePath' string I assigned in the constructor once I set the .GetTilePath property to my javascript function.

//Add layer
var tileSourceSpec = new VETileSourceSpecification("MyTileLayer", 'GetTilePath');
tileSourceSpec.GetTilePath = GetTilePath;
tileSourceSpec.MinZoom = 1;
tileSourceSpec.MaxZoom = 16;
tileSourceSpec.Opacity=0.5;
map.AddTileLayer(tileSourceSpec, true);





Re: VETileSourceSpecification.GetTilePath - Gone in v5?

James Thurley

Hi Stewart,

Yep, you're right, the GetTilePath property still exists but isn't documented. Seems to work fine for me now Smile

Actually think I did try this before, but hadn't noticed that the map.AddTileSource(..) method had changed to map.AddTileLayer(..) so it was failing on that too.

Cheers,

James.