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.
-
KML is specially WGS84 you would need your base-map to accommodate the KMLMapperz– Mapperz ♦2011年10月17日 17:38:05 +00:00Commented 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?Carter– Carter2011年10月17日 17:49:34 +00:00Commented Oct 17, 2011 at 17:49
2 Answers 2
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.
-
please update the links with latest example.Sunil– Sunil2013年08月23日 05:32:53 +00:00Commented Aug 23, 2013 at 5:32
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.
-
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.Derek Swingley– Derek Swingley2011年10月18日 01:58:28 +00:00Commented Oct 18, 2011 at 1:58
Explore related questions
See similar questions with these tags.