Cerberu5


Hi everyone,


I am currently implementing an application to change tile layer colours on the fly and was wondering if anyone knew of a way to force Virtual Earth to re-request the layer tiles from the tile server


Any input would be greatly appreciated...


Thanks,


Matt




Re: Forcing a tile layer refresh

WesleyJung


Hey,

I have been also struggling for this issues for a week.

According to the VirtualEarth sdk document, it can be done through the following.

1) change property of VETileSourceSpecification

ex) VETileSourceSpecification.Opacity = 0.9; // for example earlier was 1.0

2) call VEMap.ShowTileLayer(layerID); again..

But this approach doesn't work always. I don't know whay.

Thanks







Re: Forcing a tile layer refresh

Derrick

What about trying to delete the current layer and adding a new layer

Or maybe Hiding the layer before Showing the layer






Re: Forcing a tile layer refresh

WesleyJung

I tried both hide_then_show and delete_then_add.

No luck.

To see the change of your tile, you have to zoom in/out.

I am stuck here






Re: Forcing a tile layer refresh

ErikS

Remember that your browser is caching tiles so unless you change zoom-level or extent, there won't be a request for new tiles. You probably need to implement a custom tile naming scheme that would include a string that changes when you've generated new tiles.

From the "Building your own tile server" article:

The Specification for Custom Names

If you chose to use a custom naming scheme, you will need to set a different set of parameters. Specifically, the NumServers parameter and TileSource are ignored. Instead, you set the GetTilePath() property to point to a JavaScript function. Your JavaScript function receives a VETileContext parameter which provides the x and y position of the center of the tile and the zoom level. Your function would have to convert these values into a fully qualified path.

Note that this system only works for 2D tile layers. If you want to see layers in 3D, you must use the Virtual Earth naming scheme.



your javascript function would generate the standard naming string and tack on something like "-"+(new Date()).getSeconds() to the end. This will force the browser to request that tile from the server since the name doesn't match the current tile name. Your server side cache generator would need to ignore that extra bit.

e