ThinkGeo.com    |     Blog    |     Wiki    |     Support

InMemoreyFeatureLayer in Client side access

Hi,
I am trying to access InMemoreyFeatureLayer in client, but i am getting only Overlay, not Layer.

Server Side Code:
if (wfMap.CustomOverlays.Contains(“AircraftOverlay”))
{
InMemoryFeatureLayer imAircraftLayer = (InMemoryFeatureLayer)((LayerOverlay)wfMap.CustomOverlays[“AircraftOverlay”]).Layers[“AircraftLayer”];

//Do Something
}

Client Side Code:
var olMap;
var OnMapCreated = function (map) {
olMap = map;
var overlay = olMap.getLayer(“AircraftOverlay”);

//Do Something
}

I tried in many ways, but i didn’t. Please give exact code for getting Layer in Client Side.

Thanks,
Riyaz

Hi Riyaz,

The server side layer don’t exist in client side.

The server side overlay is the layer in client side, and inside it is the tile images, you cannot do operation for the images, so please handle them in server side.

Regards,

Ethan

Hi Ethan,
Thanks for your reply, You mean All the functionality in Web edition be only server side functionality. We can’t achieve same functionality working in Server side through Client Side.

We got an issue in Server side functionality, If we execute any functionality, it’s execute server side then Whole Map is Reloading each and every time.

So we want to execute all functionality with out Refreshing whole map.Please Tell me correct solution for resolve this issue.

Thanks,
Riyaz

Hi Riyaz,

Thanks to let us know your question. We get your email also and it looks as below is your question.

Q: On Map mouse move we need to access a Inmemoryfeature layer in client side, so that we can able to display tool tip for Plotted Data.

A: Just like I mentioned, you cannot find server layer in client side, it only have the tile images. But the client side also have some JavaScript layer and you can do some operation there, then pass the result back to server.
You can refer the sample in “HowDoISamples”, the “Highlight a Feature While Hovering” sample shows how to bind mouse hover event and make it works in client side. If you want to display something for example tool tip you need to write more custom JavaScript code, here I found an topic which contains some sample code, wish that’s helpful: Showing tooltip for line, point feature shape file on client side

Q: Accessing Inmemoryfeature layer in Client side. so that we can edit or modify those layers in client side.

A: Please refer the first question reply, you cannot find inmemory featurelayer so you cannot operate it. The solution should be you get all shapes from server side, then render them by OpenLayer’s API in client side, after you edit them then sent the result back to server side, it’s a little complex.

Q: So we want to execute all functionality with out Refreshing whole map.

A: Any operation related with server side will make the page refresh, the solution is use callback or your custom AJAX code to implement that. In the post 4893 the code shows how to implement that by callback. And in fact we have some client side API here, if your function is related to them, it won’t refresh map: Client API Documentation for Map Suite Web Edition

Regards,

Ethan