ThinkGeo.com    |     Blog    |     Wiki    |     Support

Map.getLayer("layerOverlay") error

Dear All,
I am trying to get layer from client script side. but i am getting following error.

code

var map = document.getElementById(“wfMap”);
var overlay = map.getLayer(“FIROverlay”);
overlay.transparancy = 100;
overlay.redraw(true);

Please tell me what actually the error. How can I resolve it.

Thanks,
Riyaz

Hi Riyaz,

Please refer this sample:

ClientSideGetLayer.zip (173.9 KB)

Regards,

Ethan

Hi Ethan,
it’s work out. Thanks for you reply.

Points

  1. Overlay opacity drawing on client side fine but it’s taking more time to render it.
    Same thing if I applied by server side it’s rendering fast. I applied opacity value to the layer on server side.
    it that impact on rendering time on client side.
    Finally I want to change opacity value on Client side with quick rendering only specified Overlay.

  2. I am getting layer by server side as like this
    InMemoryFeatureLayer imPtSigmet = (InMemoryFeatureLayer)((LayerOverlay)wfMap.CustomOverlays[“SigmetPointOverLay”]).Layers[“SigmetPointLayer”];

Like this we can possible to get in Client Side.
I tried like this but it didn’t work out.
var layer = overlay.Layers[“FIRLayer”]

3.Let me clarify one thing, what are the functionalities there in server side same like that we can possible to get in Client side also. If it Possible how we can see list of functionalities(Methods,Properties,Events…etc)

Thanks,
Riyaz

Hi Riyaz,

  1. The sample shows how to modify target overlay’s opacity.
  2. In client side, it don’t have the “layer”, so you cannot find it. The “layer” in client side is the “overlay” in server side, if you need to operate some special layer, the simplest way is put it in a standalone overlay.
  3. Many function in server side is not supported by client side, the client side is based on the JavaScript library OpenLayers 2, so you can use the OpenLayers api to handle it: http://dev.openlayers.org/releases/OpenLayers-2.13.1/doc/apidocs/files/OpenLayers-js.html and you can view this topic to understand client API more: Client API Documentation for Map Suite Web Edition.

Wish that’s helpful.

Regards,

Ethan

Hi Ethan,
it’s Helpful.

Thanks,
Riyaz

Hi Riyaz,

I am glad to hear that’s helpful.

Regards,

Ethan