<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Leaflet dynamicMapLayer popup question in Open Source Mapping Libraries Ques.</title>
    <link>https://community.esri.com/t5/open-source-mapping-libraries-ques/leaflet-dynamicmaplayer-popup-question/m-p/824492#M568</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;when we tagged Release Candidate 6, we enhanced identify so that individual features in the response would include a new property 'layerId' to explain which layer in the map service the individual feature came from.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after you bump the CDN version of esri-leaflet in your sample, you'll be able to access:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14261907738915929 jive_text_macro" data-renderedposition="113_8_912_16" jivemacro_uid="_14261907738915929"&gt;&lt;P&gt;featureCollection.features&lt;I&gt;.layerId&lt;/I&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RC6 release notes&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/esri-leaflet/releases/tag/v1.0.0-rc.6" title="https://github.com/Esri/esri-leaflet/releases/tag/v1.0.0-rc.6"&gt;Release Release Candidate 6 · Esri/esri-leaflet · GitHub&lt;/A&gt;&lt;/P&gt;&lt;P&gt;the specific Pull Request that introduced the functionality&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/esri-leaflet/pull/462/" style="line-height: 1.5;" title="https://github.com/Esri/esri-leaflet/pull/462/"&gt;https://github.com/Esri/esri-leaflet/pull/462/&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 Mar 2015 20:06:31 GMT</pubDate>
    <dc:creator>JohnGravois</dc:creator>
    <dc:date>2015-03-12T20:06:31Z</dc:date>
    <item>
      <title>Leaflet dynamicMapLayer popup question</title>
      <link>https://community.esri.com/t5/open-source-mapping-libraries-ques/leaflet-dynamicmaplayer-popup-question/m-p/824491#M567</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; I am very new to Leaflet.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to set up a dynamicMapLayer to have a popup for every layer in the map service.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;All of the examples that I have seen so far use canned examples with simple layer definitions.&amp;nbsp; I am using a map service with more than two dozen layers, each of which has a distinct set of fields.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I would like to do is make popup definitions that are distinct to each layer.&amp;nbsp; Where I am getting stuck is that I do not know how to identify the layer names that are gathered into the featureCollection array.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is the code that I am using below.&amp;nbsp; It returns a popup when it identifies a feature with the Facility Identifier and LegacyID fields.&lt;/P&gt;
&lt;P&gt;Ideally, I would have a method return the appropriate popup fields based on the layer name (i.e. Sewer Manholes, Streets, Sewer Cleanout, etc...).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can anyone point me in the right direction?&amp;nbsp;&amp;nbsp; Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class="lia-code-sample line-numbers language-none" tabindex="0"&gt;&lt;CODE&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
  &amp;lt;head&amp;gt;
    &amp;lt;meta charset=utf-8 /&amp;gt;
  &amp;lt;title&amp;gt;Learning Leaflet&amp;lt;/title&amp;gt;
  &amp;lt;meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' /&amp;gt;

  &amp;lt;!-- Load Leaflet from CDN--&amp;gt;
  &amp;lt;link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" /&amp;gt;
  &amp;lt;script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"&amp;gt;&amp;lt;/script&amp;gt;

  &amp;lt;script src="http://cdn-geoweb.s3.amazonaws.com/esri-leaflet/0.0.1-beta.5/esri-leaflet.js"&amp;gt;&amp;lt;/script&amp;gt;

    &amp;lt;style&amp;gt;
      html, body,  #map {
        width : 100%;
        height : 100%;
      }
    &amp;lt;/style&amp;gt;
  &amp;lt;/head&amp;gt;
  &amp;lt;body&amp;gt;
    &amp;lt;div id="map"&amp;gt;&amp;lt;/div&amp;gt;
    &amp;lt;script&amp;gt;
      document.getElement
      var map = L.map('map').setView([35.578, -82.50], 17);
      
      &amp;lt;!-- L.esri.basemapLayer("Gray").addTo(map); --&amp;gt;
      
      var networkInfrastructure = L.esri.dynamicMapLayer('http://gis.msdbc.org/arcgis/rest/services/InternalViewer/NetworkInfrastructureI/MapServer',{useCors: false}).addTo(map);

      var networkArray = networkInfrastructure.getLayers();
      
      networkInfrastructure.bindPopup(function(error, featureCollection) {
        if (error || featureCollection.features.length === 0) {
          alert("you missed.");    
          return false;
        } else {
          
          
          var obj = featureCollection.features[1].properties;
          
          // popup info
          var facilityID = obj["Facility Identifier"];
          var legacyID = obj["LEGACYID"];
          
          // return popup
          return 'Facility ID: ' + facilityID + "&amp;lt;br&amp;gt;" +
                 'Legacy ID: ' + legacyID;
        }
    });
      
      
    &amp;lt;/script&amp;gt;
  &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 28 Aug 2023 13:48:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/open-source-mapping-libraries-ques/leaflet-dynamicmaplayer-popup-question/m-p/824491#M567</guid>
      <dc:creator>CoreySmolik1</dc:creator>
      <dc:date>2023-08-28T13:48:40Z</dc:date>
    </item>
    <item>
      <title>Re: Leaflet dynamicMapLayer popup question</title>
      <link>https://community.esri.com/t5/open-source-mapping-libraries-ques/leaflet-dynamicmaplayer-popup-question/m-p/824492#M568</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;when we tagged Release Candidate 6, we enhanced identify so that individual features in the response would include a new property 'layerId' to explain which layer in the map service the individual feature came from.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after you bump the CDN version of esri-leaflet in your sample, you'll be able to access:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14261907738915929 jive_text_macro" data-renderedposition="113_8_912_16" jivemacro_uid="_14261907738915929"&gt;&lt;P&gt;featureCollection.features&lt;I&gt;.layerId&lt;/I&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RC6 release notes&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/esri-leaflet/releases/tag/v1.0.0-rc.6" title="https://github.com/Esri/esri-leaflet/releases/tag/v1.0.0-rc.6"&gt;Release Release Candidate 6 · Esri/esri-leaflet · GitHub&lt;/A&gt;&lt;/P&gt;&lt;P&gt;the specific Pull Request that introduced the functionality&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/esri-leaflet/pull/462/" style="line-height: 1.5;" title="https://github.com/Esri/esri-leaflet/pull/462/"&gt;https://github.com/Esri/esri-leaflet/pull/462/&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Mar 2015 20:06:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/open-source-mapping-libraries-ques/leaflet-dynamicmaplayer-popup-question/m-p/824492#M568</guid>
      <dc:creator>JohnGravois</dc:creator>
      <dc:date>2015-03-12T20:06:31Z</dc:date>
    </item>
    <item>
      <title>Re: Leaflet dynamicMapLayer popup question</title>
      <link>https://community.esri.com/t5/open-source-mapping-libraries-ques/leaflet-dynamicmaplayer-popup-question/m-p/824493#M569</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much, John!&amp;nbsp; I appreciate you for both helping me and not mocking my inexperience.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I changed the reference to the script on my local host and immediately saw the layer-id present in the featureCollection object.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Mar 2015 14:44:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/open-source-mapping-libraries-ques/leaflet-dynamicmaplayer-popup-question/m-p/824493#M569</guid>
      <dc:creator>CoreySmolik1</dc:creator>
      <dc:date>2015-03-13T14:44:10Z</dc:date>
    </item>
    <item>
      <title>Re: Leaflet dynamicMapLayer popup question</title>
      <link>https://community.esri.com/t5/open-source-mapping-libraries-ques/leaflet-dynamicmaplayer-popup-question/m-p/824494#M570</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;no sweat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Mar 2015 03:36:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/open-source-mapping-libraries-ques/leaflet-dynamicmaplayer-popup-question/m-p/824494#M570</guid>
      <dc:creator>JohnGravois</dc:creator>
      <dc:date>2015-03-14T03:36:19Z</dc:date>
    </item>
  </channel>
</rss>

