ThinkGeo.com    |     Documentation    |     Premium Support

Get layer in client side After adding from server side

How to Get a Layer in client side ol map object after adding it from server side ? I don’t wanna do a full page reload .
or is there any other way to recall the onmapcreate function after adding a layeroverlay from server side ?
@Ethan It will be very helpful for my application.

Hi Bibek,

If your page hadn’t complete render, and you add overlay in server side after that, you cannot get the layer in client side unless reload the page.

Because it doesn’t exist in client side at all.

Of course you can directly create a layer by openlayers API in client side, and add that into map by javascript, but after page refresh it will disappear and the server side overlays will cover them.

Regards,

Ethan