2

Specifically into NAD83.

Google tells me that KML only supports WGS84, but I can't seem to find much info on being able to reproject KML using ESRI's Javascript API.

Basically, I've got this base map in Nad83 and I need to overlay some kml.

asked Oct 17, 2011 at 17:27
2
  • KML is specially WGS84 you would need your base-map to accommodate the KML Commented Oct 17, 2011 at 17:38
  • I realize that, but is there no way to do the reprojection on the fly with the js api? Commented Oct 17, 2011 at 17:49

2 Answers 2

5

Yes, the ArcGIS API for JavaScript's KMLLayer class relies on a hosted service that converts a KML file to JSON. To re-project, specify an outSR in the constructor options when creating your KML layer.

answered Oct 17, 2011 at 20:57
1
  • please update the links with latest example. Commented Aug 23, 2013 at 5:32
0

No, the js api cannot reproject on the fly. The KML needs to match the base service that you are using. The js api can convert WGS84 geometries to Web Mercator, but that is all it can do.

answered Oct 18, 2011 at 1:22
1
  • For the use case outlined by Carter, I disagree. When's the last time you saw a KML file in anything other than WGS84? With the JS API, when you create a KMLLayer, the KML file is sent to a service and converted to JSON. As part of this conversion, you can specify a spatial reference(wkid or wkt) and the features from the KML file will be returned in that spatial reference. The re-projection isn't happening client side but you do end up with re-projected features. Side note: don't forget that the JS API can also convert Web Mercator --> Geographic client side as well. Commented Oct 18, 2011 at 1:58

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.