Hi Support,
Can you please show me how to implement the transition effect setting for zoom or pan? The reason I asked is because I am trying to make the zooming and panning as smooth as butter. At the moment all the examples are jaggy.
I’m trying to achieve similar to the OpenLayer implementation. See this link:
openlayers.org/dev/examples/clientzoom.html
Let me know if this is achievable in ThinkGeo.
Kind regards,
Benito Gamas
Transition Effect
Hi Benito,
You can set it in background for any overlay like this:
WorldMapKitWmsWebOverlay overlay = new WorldMapKitWmsWebOverlay();
overlay.TransitionEffect = TransitionEffect.Stretching;
And if you want to set it in JS, please set transitionEffect: ‘resize’ for each layer.
Regards,
Don
Hi Don,
Thanks for your reply. I’ve tried it for my custom overlays. Still nowhere near the smoothness as with the OpenLayer’s implementation. How about doing it for the base overlays (OpenStreetMap & Bing)? Is it possible?
Thanks,
Benito Gamas
Hi Benito,
It looks you cannot set this value for BingMapsOverlay and OpenStreetMapOverlay background, but you can put BingMapLayer and OpenStreetMapLayer in layerOverlay and set the value to it.
I am not sure why it still nowhere near the smoothness Openlayers’, because it just set the same like your sample from OpenLayers. Have you set the value to each overlay?
Regards,
Don
Hi Don,
Thanks for your reply.
Yes, I set the value to all my custom overlays (they contain feature layers from sql), but I didn’t set it to my base overlays because I don’t know how to do it.
At the moment, I have my custom base overlay switcher which switches either OSM, Bing or Google.
Can you please show it to my code below?
private static void BuildBaseLayers(OverlayCollection overlays)
{
// OpenStreet Map
overlays.OpenStreetMapOverlay(“Open Street Map”)
.IsBaseOverlay(true)
.IsVisible(false);
// Bing Raod Map
overlays.BingMapsOverlay(“Bing Road”)
.MapType(BingMapsStyle.Road)
.IsBaseOverlay(true)
.IsVisible(false);
// Bing Aerial Map
overlays.BingMapsOverlay(“Bing Aerial”)
.MapType(BingMapsStyle.Aerial)
.IsBaseOverlay(true)
.IsVisible(false);
// Bing Aerial Map
overlays.BingMapsOverlay(“Bing Aerial + Labels”)
.MapType(BingMapsStyle.Hybrid)
.IsBaseOverlay(true)
.IsVisible(false);
}
Thanks,
Benito Gamas
Hi Benito,
We cannot set the value for BingMapsOverlay or OpenStreetMapOverlay background.
Please add these JavaScript code in your view:
<script type=“text/javascript”>
OnMapCreated = function (map) {
var count = map.layers.length;
for (var i = 0; i < count; i++) {
map.layers[i].transitionEffect = ‘resize’;
}
};
</script>
It should be placed before any div.
Regards,
Don
Hi Don,
That works nicely. I can now see the new effect but still not super smooth. I guess it’s because of the large number of dynamic layers I put on the map.
Oh well, need to move on. Thank you very much for your help!
Cheers,
Benito Gamas
Hi Benito,
I am glad to hear that works for you.
If the new effect not so smooth like online sample from OpenLayers, one reason should be our OpenLayers version isn’t the newest. We are waiting for the incoming new 3.0, so we haven’t upgraded Openlayers to latest version for keep version is stable.
Any question please let me know.
Regards,
Don