AnsweredAssumed Answered

Can someone point me to complete working code (HTML and Javascript) that shows how to place predefined icons ( symbols) at a lat long? 

Question asked by arthurheyman on Nov 6, 2016
Latest reply on Nov 8, 2016 by rscheitlin

Can someone point me to complete working code (HTML and Javascript) that shows how to place predefined icons ( symbols) at a lat long? 

I see code pieces that purport to do this, but without being inside  working examples they are of little use to me. 

We are trying to do a few things at once:

1) create simple icons with embedded text. The text will reflect data. In other words a circle, say, that has date and time info from a DB

2) Place these icons at specific known point; in this case an intersection of roads. We'll know the lat long at the start.

What I hope to get working is the creation of a small library of icons. Logic in the code will choose one or another, then do a DB lookup and place info in the icons , then place them on the map.

 

As it stands I have working code to draw circles :

], function(
Map, Point, SimpleMarkerSymbol, Graphic, GraphicsLayer
) {
map = new Map("map", {
basemap: "streets",
center: [-73.380801,40.80561],
zoom: 10
});
map.on("load", function() {
var gl = new GraphicsLayer();
var p = new Point(-73.180801, 40.80560);
var p2 = new Point(-73.190801, 40.80560);
var s = new SimpleMarkerSymbol().setSize(60);

var g2 = new Graphic(p2, s);
var g = new Graphic(p, s);


gl.add(g2);
gl.add(g);
map.addLayer(gl);
});
});

 

but how to take this further? Seems like the next step is to pull from a library of symbols. How?

Outcomes