In 3.0.2 Beta the map control had the nice event "OnLayersDrawn". Where is that in 3.0.131 Beta? I could find only the client event "OnClientDrawEnd". I subscribed this event, but it will be never thrown.
thanks Anke
In 3.0.2 Beta the map control had the nice event "OnLayersDrawn". Where is that in 3.0.131 Beta? I could find only the client event "OnClientDrawEnd". I subscribed this event, but it will be never thrown.
thanks Anke
Anke,
Thanks for the post!
Web edition started to use Multi-threading for tiling since 3.0.117, to avoid some side-effect, we removed the event “LayerDrawn” temporarily. We will add it back some time in the future and sorry for the inconvenience now.
“OnClientDrawEnd” is for defining a client part event which will be raised after editing the map at client side. For example, after adding a point to the map in “TrackPoint” mode, it will raise that event.
Any queries just let us know.
Ben
It looks like OnClientDrawEnd isnt working in the current version. For me, it fires on the first call to Map1.SetDrawMode() with any mode. Other than that, it never fires at all. Same goes for OnClientEditEnd.
Rob,
We couldn’t recreate your issure and the OnClientDrawEnd / OnClientEditEnd events are both properly raised after I draw / edit a shape on the map. Also in my test, Map1.SetDrawMode() has nothing to do with the 2 events. Can you let me know more description about this issue or it will be great if you can provide a small sample for this.
Thanks,
Ben
My bad, I was calling it wrong.
I was setting a simple OnClientDrawEnd=“alert(‘test’);” to try to get it to fire. After looking through some of the new posts about the new 3.1 client events, I realized that you must call it like OnClientDrawEnd=“function(map){alert(‘test’);}”
You might want to document this better.
Rob,
Sorry for the inconvenience. Documentation might be our short slab, we have realized that and will focus on that making a pretty nice one in a couple months. Thanks for the reminding!
Ben
does the OnClientDrawEnd event is working on 7.0?
I need to take from 100 to 1000 images in different locations. So the idea is to make an iteration with a list of feature ids and then center the map on each one, take a picture and save it on the server. but i need to wait until the map is drawn and then take the image.
Do you have another idea or know which event could i use?
Hi Rodrigo,
The "OnClientDrawEnd" event is still not supported in Map Suite 7.0, the reason is there are some other special base layers like google,bing etc which use their own Apis to support it. But if we can skip those layers, we can use the below codes to detect:
<script type="text/javascript">
var openlayermap, layerscount = 0;
OnMapCreated = function (map) {
openlayermap = map;
var layers = map.layers;
for (var i = 0; i < layers.length; i++) {
layers[i].events.register("loadend", layers[i], function () {
layerscount++;
if (layerscount == openlayermap.layers.length) {
alert("Map loaded!");
}
});
}
}
</script>
Hope it helps.
Regards,
Johnny