AnsweredAssumed Answered

Add XY Location to Map

Question asked by jay.kapalczynski on Jan 26, 2017
Latest reply on Jan 26, 2017 by tsellste

I have an old script that I am trying to use and it does not seem to work.  The topo comes up but when I enter an XY and hit Go nothing happens....

I updated the 2 lines below


<link rel="stylesheet" href="">
<script src=""></script>


Does ANYTHING stand out that is not used in the current js 3.19?



<!DOCTYPE html>  
  <title>Simple Map</title> 
  <link rel="stylesheet" href=""> 
  <script src=""></script> 
    html, body, #map { 
        height: 100%; 
        width: 100%; 
        margin: 0; 
        padding: 0; 
      body { 
        background-color: #FFF; 
        overflow: hidden; 
        font-family: "Trebuchet MS"; 
    var map; 
              function(Map, SimpleLineSymbol, Graphic, SimpleMarkerSymbol, Color, on, dom, Point) { 
        map = new Map("map", { 
          basemap: "topo", 
          center: [-122.45, 37.75], // longitude, latitude 
          zoom: 13 
        var symbol = new SimpleMarkerSymbol( 
         new SimpleLineSymbol( 
            new Color([0, 0, 255, 0.5]), 
         new Color([0, 0, 255]) 

         function coordinates() { 
               var lat = document.getElementById("sel_lat").value 
               var longitude = document.getElementById("sel_long").value 
               var coord = webMercatorUtils.lngLatToXY(longitude, lat); 
               var mp = new Point(longitude, lat); 
               var graphic = new Graphic(mp, symbol); 
               map.centerAndZoom(mp, 9);
         on(dom.byId("go"), "click", coordinates); 

    <div id="map">Tag Long:<input id="sel_long" type="text"> 
      <br /> 
       Tag Lat:<input id="sel_lat" type="text"> 
      <br /> 
      <button id="go">GO</button>