If i initiate a callback and add custom overlays to the map, then try and redraw client side, those overlays don't exist, unless I create them when I first create the map, and then replace them in the call back.
Client Side Map only has overlays first added, not overlays added via callback
Hello Eric,
That is a wrong way to add CustomOverlays with Ajax, because the map won’t be serialized using Ajax to call server method RaiseCallbackEvent. It means that the openlayers object won’t be created again. You should add that overlay at the begining, then using RaiseCallbackEvent to get that overlay and update it.
Please feel free to let us know if you have any queries.
Regards,
Gary
is there anyway to add an overlay after the map is first setup and still be able to access those layers on the client side?? It is difficult to add all my overlays initially, because I don't know what the user will want.
Hello Eric,
Sorry for the inconvenience, but I think it's hard to fit this requirement.
You can create new overlay by using Openlayer in client side, by use map.addLayers(); but the problem is even you created layer(it calls layer in openlayer, calls overlay in map control), you don't have a way to synchronize to server side, so once one postback finished, the overlay will gone.
Regards,
Gary