Pregunta

I work with Openlayer and I Have multiple layers (A,B,C,D).

A layer is Base layer. I want Click Layer C to get info, but action belong Layer A as a base layer.

Can anybody help me?

¿Fue útil?

Solución

If you read through the Openlayers API documentation you will see that it is possible to have click actions be added to multiple layers. Then one click can set of an action from these multiple layers.

You can find a list of example here. The example of this that would interest you is feature-events. The Javascript used in the example can be viewed here.

As you already have a click event happening on your base layer you may need to turn it off or remove it if you just want the information from layer C and the click functionality to not also occur on the base layer.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top