akashmagoon

Get and Post Coordinates

Discussion created by akashmagoon on Jun 25, 2012
I have this code below.

This function allows me to click anywhere on my map and a infowindow displays the Coordinates of the clicked location

how can i edit this code below so that it GETS and the coordinates and POST them in a new page. I know how to do this is PHP but not in JAVA



Also is there a function i can add for onclick=Something?
Thanks


function projectToWebMercator(evt) {
        map.graphics.clear();
       
        var point = evt.mapPoint;
        var symbol = new esri.symbol.SimpleMarkerSymbol().setStyle(esri.symbol.SimpleMarkerSymbol.STYLE_DIAMOND);

      
        var graphic = new esri.Graphic(point, symbol);
        var outSR = new esri.SpatialReference({ wkid: 4326});
       
        map.graphics.add(graphic);

        gsvc.project([ point ], outSR, function(projectedPoints) {
          pt = projectedPoints[0];
          graphic.setInfoTemplate(new esri.InfoTemplate("Coordinates",
            "<p> X: " + pt.x +
            "<br/> Y: " + pt.y +
            "</p>"  +
            "<input type='button' value='Pin Here' onclick='Something?();' />" +
            "<div id='latlong'></div>"));
          map.infoWindow
            .setTitle(graphic.getTitle())
            .setContent(graphic.getContent())
            .show(evt.screenPoint, map.getInfoWindowAnchor(evt.screenPoint));

Outcomes