문제

For example I have 2 cordinates: 54.674705589 and 25.289369548 and I want place this cordinates on map on button click Like in this example

But this example is for address, I have cordinates, it's possible with this example make what I need ?

function locate() {
          map.graphics.clear();
          var address = {
            "SingleLine": dom.byId("address").value
          };
          locator.outSpatialReference = map.spatialReference;
          var options = {
            address: address,
            outFields: ["Loc_name"]
          }
          locator.addressToLocations(options);
        }
도움이 되었습니까?

해결책

This example is an example of locator.

What is locator: - input: address - output: coordinates

so you can still inspire by the example, you could just ignore the locator part of code, and create a gemometry even a graphic from your coordinate, (take care of coordinate systeme) and add it on the map

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top