<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<font face="Arial">Jair,<br>
<br>
I am not an expert...if this doesn't work, I hope someelse helps
you.<br>
I am sure there are other ways to achive this.<br>
<br>
once said that,<br>
<br>
When creating your layers you need to add an "id" attribute. See
the example bellow.<br>
Then, use get the onclic mouse event, and<br>
<br>
<br>
earthQuakeLayer = new ol.layer.Vector({<br>
source: new ol.source.Vector({<br>
....<br>
}),<br>
id:'yourlayerid' <br>
});<br>
<br>
Then , when listening the clic event, you need to use something
similar to this.<br>
<br>
<br>
map.on('click', function (e) {<br>
map.forEachFeatureAtPixel(e.pixel, function (feature, layer) {<br>
console.debug(layer.get('id'));<br>
});<br>
} <br>
<br>
<br>
<br>
</font><b>Toni Hernández Vallès</b>
<br>
<div class="moz-signature"><span style="font-size:8.5pt">
Servei de Sistemes d'Informació Geogràfica i Teledetecció<br>
-<br>
Universitat de Girona<br>
<b>SIGTE</b><br>
-<br>
Pl. Ferrater Mora 1<br>
17071 Girona<br>
Tel +34 972 418 039 (7026 intern)<br>
<a href="mailto:toni@sigte.udg.edu">toni@sigte.udg.edu</a>
<br>
<br>
<a href="http://www.sigte.udg.edu">http://www.sigte.udg.edu</a><br>
Twitter <a href="http://twitter.com/SIGTE_UDG">http://twitter.com/SIGTE_UDG</a><br>
<br>
</span></div>
<div class="moz-cite-prefix">On 05/10/2015 21:30, Jair Santos wrote:<br>
</div>
<blockquote cite="mid:007001d0ffa4$43afd2a0$cb0f77e0$@gmail.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<meta name="Generator" content="Microsoft Word 15 (filtered
medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<div>
<div>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Hello,<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">In
a multi-layer map how to determine the clicked layer
name when the user click on the map?<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">JJ.<o:p></o:p></span></p>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/openlayers-users">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a></pre>
</blockquote>
<br>
</body>
</html>