call addFeature with geometry for a featureserver

3455
1
04-10-2015 02:59 PM
billzhang
New Contributor

I have a featureServer defined. In invoked addFeature call with the following information including the geometry which I set to longitude and latitude. This place should be in Hawaii area. However, after I added this layer to a map, this point showed up in Africa. I looked at the point that showed up in Hawaii, its x and y showed a big x and y. Both examples are shown below. So what should I put in the geometry field in my request?

Point showed up in Africa which should have shown in Hawaii

Request:

...

"geometry" : {

        "x" : -155.445052,

        "y" : 19.550263

      }

+++++++++++++++++++++++++++Response:

WorkOrderNo:    9997

WorkOrderDesc:    1750 Kaumana Drive

Priority:    2

LATITUDE:    19.550263

LONGTITUDE:    -155.445052

geometry   

Point:

X: 19.550263

Y: -155.445052

Point that shows in Hawaii showed X Y value like these.

X: -17304064

Y: 2205688

0 Kudos
1 Reply
OwenEarley
Occasional Contributor III

The coordinates are most likely Web Mercator. If you are using the Javascript API you can use the geographicToWebMercator() function to convert your geographic coordinates before sending the addFeature request.

0 Kudos