AnsweredAssumed Answered

why the coordinates from view.toMap() are incorrect in east hemisphere?

Question asked by ohlasd on Jul 17, 2020
Latest reply on Jul 30, 2020 by harishp_Chetu


Does anyone know why the coordinates output from view.toMap are incorrect in the east hemisphere? I simplified the code to be the following. You run it and click the map anywhere and you will find that the output coordinates from cursorPoint are sometimes different from the one shown in base map (the correct one).

I actually found that X is correct sometimes if you move the map from left to right or from east to west.

If you click in Asia area and you will see that X is negative (should be positive)! Did anyone notice this before?


<!DOCTYPE html>
    <meta charset="utf-8" />
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no" />
    <title>Intro to MapView - Create a 2D map</title>
      #viewDiv {
    <link rel="stylesheet" href="" />
    <script src=""></script>

        var map = new Map({
          basemap: "streets"

        var view = new MapView({
          container: "viewDiv"// Reference to the scene div created in step 5
          map: map, // Reference to the map object created before the scene
          zoom: 4// Sets zoom level based on level of detail (LOD)
          center: [-11838// Sets center point of view using longitude,latitude

        //widget of coordinate
        var ccWidget = new CoordinateConversion(
          view: view
        view.ui.add(ccWidget, "bottom-right");

            var cursorPoint = view.toMap(event)

    <div id="viewDiv"></div>