hi i have saved markers in db, but now i want to get them and show them on my map view, I have used the following code. and call them in view.when. My markers do not show up plus i don't know what is the error, i have followed below link How to plot multiple points on a map? to show markers from db plus my map stops it editing work.
Query : My markers do not show .
Query : can i display content of popup saved last time in db.How?
this is my code.
view.when(function() {
// Add the boundary polygon and new loted polygon graphics on view
const property_vertices = <?php echo json_encode($map_ring_coordinate);?>;
addGraphics(property_vertices);
addMarker();
///some more code below
}
function addMarker(){
var getmarker=<?php echo json_encode($smarkers);?>;
getmarker.forEach(function(marker){
console.log(marker);
var p = new Point({
longitude: marker.x,
latitude: marker.y,
spatialReference: { wkid: 4326 }
});
});
var g = new Graphic({
geometry: webMercatorUtils.geographicToWebMercator(p),
symbol: textSymbol
})
markerGL.add(g);
}
I get the following 2 objects in console.
Object { x: "172.49720789367655", y: "-43.48319644512304" }
Object { x: "172.50933147842412", y: "-43.48894119812065" }