map.on("click", function(evt){ // Remove old Graphics myGraphicsLayer.graphics.forEach(function(g){ if(g.visible === true) myGraphicsLayer.remove(g); }); var symbol, point, graphic; var img = new Image(); img.src = '../../uihlein/test/images/star.png'; img.onload = function() { symbol = new PictureMarkerSymbol('../../uihlein/test/images/star.png', this.width, this.height); point = new Point(evt.mapPoint.getLongitude(), evt.mapPoint.getLatitude()); graphic = new Graphic(point, symbol); myGraphicsLayer.add(graphic); map.infoWindow.show(point); } });
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und vieles mehr. Neu hier? Erstelle ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.