AnsweredAssumed Answered

Display a popupTemplate on Multipoint (JavaScript 4.4)

Question asked by michaellodes on Aug 24, 2017
Latest reply on Aug 24, 2017 by TSolow-esristaff

Hello together,

 

I already managed to display a single Point (from client side) including a popupTemplate. But how can I display a popupTemplate on a big amount of Points (a few thousand) efficiently?

 

I tried to do this by adding single Points to a MultiPoint object, but failed. The points are displayed in the map, but without the popup by clicking on the point.

 

You can see a code snippet below. If I put the single Point into the Graphic object, the popupTemplate is displayed in the map. But when I put the Point into the MultiPoint object, and that MultiPoint into the Graphic, that doesn't work.

 

Could you tell me the best practice for this case please?

 

      var multipoint = new Multipoint({
          spatialReference: { wkid: 4326 }
      });
     

      var point = new Point({
        longitude: -49.97,
        latitude: 41.73

      });
     
      multipoint.addPoint(point);
     
     

      var markerSymbol = new SimpleMarkerSymbol({
        color: [226, 119, 40],
        outline: {
          color: [255, 255, 255],
          width: 2
        }
      });


      var pointGraphic = new Graphic({
        geometry: multipoint,
        symbol: markerSymbol,
                popupTemplate: {

        title: "Point 1",

        content: "Content"

      }
      });

     view.graphics.addMany([pointGraphic]);

 

Thank you very much!

 

Michael

Outcomes