<?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: Open PopUp Template Automatically on Graphic in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/open-popup-template-automatically-on-graphic/m-p/1100105#M74722</link>
    <description>&lt;P&gt;I'm trying to have multiple pop ups open like this -&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2021-09-20 at 2.01.54 PM.png" style="width: 778px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/23422i8F497B2851446796/image-dimensions/778x393?v=v2" width="778" height="393" role="button" title="Screen Shot 2021-09-20 at 2.01.54 PM.png" alt="Screen Shot 2021-09-20 at 2.01.54 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;just to confirm, you're saying no more than one info window can be open at a time, even if theyre really simple?&lt;/P&gt;</description>
    <pubDate>Mon, 20 Sep 2021 21:31:00 GMT</pubDate>
    <dc:creator>jh9</dc:creator>
    <dc:date>2021-09-20T21:31:00Z</dc:date>
    <item>
      <title>Open PopUp Template Automatically on Graphic</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/open-popup-template-automatically-on-graphic/m-p/1096068#M74584</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I currently have a pop up window template associated with a point graphic. I would like the popup window to automatically open WITH the marker (not have it show only when it is clicked). I tried doing it via the view but it is not working. Any idea what I'm doing wrong? here is my code:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;&amp;lt;script&amp;gt;
  /* eslint-disable */
  import { loadModules } from 'esri-loader';


  export default {
    mounted() {
      this.loadMap();
      this.getStops();
    },
    data() {
      return {
        stops: []
      }
    },
    methods: {
      loadMap() {
        loadModules(['esri/config', 'esri/Map', 'esri/views/MapView', "esri/Basemap", "esri/layers/VectorTileLayer", "esri/symbols/PictureMarkerSymbol", 'esri/Graphic','esri/layers/GraphicsLayer', "esri/layers/FeatureLayer"], {
            css: true
          })
          .then(([esriConfig, ArcGISMap, MapView, Basemap, VectorTileLayer, PictureMarkerSymbol, Graphic, GraphicsLayer, FeatureLayer]) =&amp;gt; {
            // create map with the given options
          esriConfig.apiKey = 

          // Where we add in the custom colored map 
          const vectorTileLayer = new VectorTileLayer({
            portalItem: {
              id: "afff5c72b30f4102be6abe62c3591803" // ID for Map Made
            },
          });

          const basemap = new Basemap({
            baseLayers: [
              vectorTileLayer
            ]
          });


          const map = new ArcGISMap({
              basemap: basemap
          });


          // assign map to this view
          this.view = new MapView({
            container: this.$el,
            map: map,
            center: [-118.48456934438383, 34.02280292519253],
            zoom: 10,
            constraints: {
            minZoom: 23,
            maxZoom: 13
          }
          });

            // initialize graphics layer, add it to the map
            const graphicsLayer = new GraphicsLayer();
            map.add(graphicsLayer);



//                       view.popup.open({
//   features: GraphicsLayer  // array of graphics or a single graphic in an array
// });


            const template = {
              "title": "Parking",
              "content": "&amp;lt;p&amp;gt;99%&amp;lt;/p&amp;gt;",
            }

      //      const parkingLots = new FeatureLayer({
      //   url: "https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Trailheads_Styled/FeatureServer/0",
      //   outFields: ["PARKING"],
      //   popupTemplate: parkingPopup 
      // });

      // map.add(parkingLots);

          this.stops.forEach((value) =&amp;gt; {
            // using a for each function to create markers on the map for all the stops 
            //Create a point

            // location 
            const point = { 
            type: "point",
            longitude: value[0],
            latitude: value[1]
          };

          // const simpleMarkerSymbol = {
          //   type: "simple-marker",
          //   color: [226, 119, 40],  // Orange
          //   outline: {
          //   color: [255, 255, 255], // White
          //   width: 1
          //   }
          // };

        // we are creating the components of a graphic, then adding to graphic
        // graphic is then being added to the graphics layer

        // what it actually looks like 
        let symbol = {
          type: "picture-marker",  // autocasts as new PictureMarkerSymbol()
          url: "https://static.arcgis.com/images/Symbols/Shapes/BlackStarLargeB.png",
          width: "64px",
          height: "64px"
        };

        // what is being added to the graphic layer 
          const pointGraphic = new Graphic({
            geometry: point,
            symbol: symbol,
            popupTemplate: template 
          });



          graphicsLayer.add(pointGraphic);


        })

          // const point = { //Create a point
          //   type: "point",
          //   longitude: -118.80657463861,
          //   latitude: 34.0005930608889
          // };
          // const simpleMarkerSymbol = {
          //   type: "simple-marker",
          //   color: [226, 119, 40],  // Orange
          //   outline: {
          //   color: [255, 255, 255], // White
          //   width: 1
          //   }
          // };
        
          // const pointGraphic = new Graphic({
          // geometry: point,
          // symbol: simpleMarkerSymbol
          // });
          // graphicsLayer.add(pointGraphic);
          

          });
      },
      async getStops() {

        // This is where we get big blue bus data initially 
        let stop = await fetch(
        'http://gtfs.bigbluebus.com/parsed/stops.geojson'
        ).then(res =&amp;gt; res.json())
      
        let obj = stop.features 
        // pushing stops data to stops array 
        obj.forEach((value) =&amp;gt; {
         this.stops.push(value.geometry.coordinates)
        })



      }
    }
  }
&amp;lt;/script&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Sep 2021 18:49:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/open-popup-template-automatically-on-graphic/m-p/1096068#M74584</guid>
      <dc:creator>jh9</dc:creator>
      <dc:date>2021-09-07T18:49:34Z</dc:date>
    </item>
    <item>
      <title>Re: Open PopUp Template Automatically on Graphic</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/open-popup-template-automatically-on-graphic/m-p/1096077#M74585</link>
      <description>&lt;P&gt;You can do this via the Popup open() method.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#open" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#open&lt;/A&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;view.popup.open({
    features: [pointGraphic],
    location: pointGraphic.geometry
});&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 07 Sep 2021 19:05:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/open-popup-template-automatically-on-graphic/m-p/1096077#M74585</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2021-09-07T19:05:26Z</dc:date>
    </item>
    <item>
      <title>Re: Open PopUp Template Automatically on Graphic</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/open-popup-template-automatically-on-graphic/m-p/1096079#M74586</link>
      <description>&lt;P&gt;Hey Rene, Thanks so much for your response. BTW, I really enjoy your youtube videos as I am very new to Esri. I tried implementing your solution but only one of the popup windows opens, and it is overridden as soon as the graphics layer loads. Not sure if I've place it in the wrong place?&lt;/P&gt;&lt;P&gt;Also - what is the difference between a popup widget and just a regular popup? I was a little confused by that and wasn't sure that methods for the pop up widget would apply to a popup template/popup.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;    methods: {
      loadMap() {
        loadModules(['esri/config', 'esri/Map', 'esri/views/MapView', "esri/Basemap", "esri/layers/VectorTileLayer", "esri/symbols/PictureMarkerSymbol", 'esri/Graphic','esri/layers/GraphicsLayer', "esri/layers/FeatureLayer"], {
            css: true
          })
          .then(([esriConfig, ArcGISMap, MapView, Basemap, VectorTileLayer, PictureMarkerSymbol, Graphic, GraphicsLayer, FeatureLayer]) =&amp;gt; {
            // create map with the given options
          esriConfig.apiKey = "";

          // Where we add in the custom colored map 
          const vectorTileLayer = new VectorTileLayer({
            portalItem: {
              id: "afff5c72b30f4102be6abe62c3591803" // ID for Map Made
            },
          });

          const basemap = new Basemap({
            baseLayers: [
              vectorTileLayer
            ]
          });


          const map = new ArcGISMap({
              basemap: basemap
          });


          // assign map to this view
          this.view = new MapView({
            container: this.$el,
            map: map,
            center: [-118.48456934438383, 34.02280292519253],
            zoom: 10,
            constraints: {
            minZoom: 23,
            maxZoom: 13
          }
          });

            // initialize graphics layer, add it to the map
            const graphicsLayer = new GraphicsLayer();
            map.add(graphicsLayer);



//                       view.popup.open({
//   features: GraphicsLayer  // array of graphics or a single graphic in an array
// });


            const template = {
              title: "Parking",
              content: "&amp;lt;p&amp;gt;99%&amp;lt;/p&amp;gt;",
            }

      //      const parkingLots = new FeatureLayer({
      //   url: "https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Trailheads_Styled/FeatureServer/0",
      //   outFields: ["PARKING"],
      //   popupTemplate: parkingPopup 
      // });

      // map.add(parkingLots);

          this.stops.forEach((value) =&amp;gt; {
            // using a for each function to create markers on the map for all the stops 
            //Create a point

            // location 
            const point = { 
            type: "point",
            longitude: value[0],
            latitude: value[1]
          };

          // const simpleMarkerSymbol = {
          //   type: "simple-marker",
          //   color: [226, 119, 40],  // Orange
          //   outline: {
          //   color: [255, 255, 255], // White
          //   width: 1
          //   }
          // };

        // we are creating the components of a graphic, then adding to graphic
        // graphic is then being added to the graphics layer

        // what it actually looks like 
        let symbol = {
          type: "picture-marker",  // autocasts as new PictureMarkerSymbol()
          url: "https://static.arcgis.com/images/Symbols/Shapes/BlackStarLargeB.png",
          width: "64px",
          height: "64px"
        };

        // what is being added to the graphic layer 
          const pointGraphic = new Graphic({
            geometry: point,
            symbol: symbol,
            popupTemplate: template 
          });




          graphicsLayer.add(pointGraphic);

          this.view.popup.open({
            features: [pointGraphic],
            location: pointGraphic.geometry
          });


        })



             

          });
      },&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Sep 2021 19:57:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/open-popup-template-automatically-on-graphic/m-p/1096079#M74586</guid>
      <dc:creator>jh9</dc:creator>
      <dc:date>2021-09-07T19:57:20Z</dc:date>
    </item>
    <item>
      <title>Re: Open PopUp Template Automatically on Graphic</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/open-popup-template-automatically-on-graphic/m-p/1096092#M74587</link>
      <description>&lt;P&gt;The main popup and Popup widget are the same.&lt;/P&gt;&lt;P&gt;Are you trying to open multiple popups? You can only have one popup open at a time. The popup can have multiple features and you can scroll through them, but only one at a time.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you need to show data from multiple features at once, you can use the Feature widget.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature.html" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;This sample places it in a side panel.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/widgets-feature-sidepanel/" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/sample-code/widgets-feature-sidepanel/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The Feature widget can display the information from the popup template from a feature, just like a popup, but you have more control over it.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Sep 2021 19:54:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/open-popup-template-automatically-on-graphic/m-p/1096092#M74587</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2021-09-07T19:54:27Z</dc:date>
    </item>
    <item>
      <title>Re: Open PopUp Template Automatically on Graphic</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/open-popup-template-automatically-on-graphic/m-p/1096308#M74595</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/7384"&gt;@ReneRubalcava&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Esri should improve that sample so the chart isn't refreshed every time the cursor is moved within the same feature.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Sep 2021 11:59:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/open-popup-template-automatically-on-graphic/m-p/1096308#M74595</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2021-09-08T11:59:48Z</dc:date>
    </item>
    <item>
      <title>Re: Open PopUp Template Automatically on Graphic</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/open-popup-template-automatically-on-graphic/m-p/1100105#M74722</link>
      <description>&lt;P&gt;I'm trying to have multiple pop ups open like this -&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2021-09-20 at 2.01.54 PM.png" style="width: 778px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/23422i8F497B2851446796/image-dimensions/778x393?v=v2" width="778" height="393" role="button" title="Screen Shot 2021-09-20 at 2.01.54 PM.png" alt="Screen Shot 2021-09-20 at 2.01.54 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;just to confirm, you're saying no more than one info window can be open at a time, even if theyre really simple?&lt;/P&gt;</description>
      <pubDate>Mon, 20 Sep 2021 21:31:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/open-popup-template-automatically-on-graphic/m-p/1100105#M74722</guid>
      <dc:creator>jh9</dc:creator>
      <dc:date>2021-09-20T21:31:00Z</dc:date>
    </item>
    <item>
      <title>Re: Open PopUp Template Automatically on Graphic</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/open-popup-template-automatically-on-graphic/m-p/1100123#M74724</link>
      <description>&lt;P&gt;That's right, only one popup at a time. It's a popup on the map, not per feature.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Sep 2021 22:24:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/open-popup-template-automatically-on-graphic/m-p/1100123#M74724</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2021-09-20T22:24:48Z</dc:date>
    </item>
  </channel>
</rss>

