简体   繁体   中英

Esri Feature Services and Google Maps API v3

Is it possible to overlay an Esri Feature service onto a Google Map using the Google Maps API?

I am using feature services hosted on ArcGIS Online. Keep in mind these are feature services, not tiled map services.

From all that I've gathered, Google Maps only appears to only support tiled map rest services. Is this correct? Has anyone had success overlaying feature services?

If you've made it this far I'll give you a little background. Our systems developer has produced numerous applications using the Google Maps API, so it would be a burden at this point to rewrite everything in OpenLayers, ESRI API, Leaflet, etc. He wants to be able to consume our ArcGIS Online mapping services, which we store as features, aka. WFS. We really do not want to go the route of having to upkeep additional versions (tiles, KML, geoJSON, etc) of the same layers. I've been experimenting with on-the-fly Esri JSON to GeoJSON conversions, but I haven't had success. I'm about ready to call it and rebuild everything with the Esri API, but I figured I'd ask first. Our staff is really in love with Google Maps so it's going to be a hard sell.

Thanks

Yes, it's possible with ArcGIS Server Link for Google Maps JavaScript API V3

https://github.com/googlemaps/v3-utility-library/tree/master/arcgislink

You can retrieve both geometries and attributes from AGS through the REST API, using the Feature Class.

Alternatively, you can implement a Geometry Service on the server side and access it through GeometryService Class.

Check arcgislink documentation:

https://htmlpreview.github.io/?https://github.com/googlemaps/v3-utility-library/blob/master/arcgislink/docs/reference.html

It is viable, but it may have performance issue.

You can make a call to the feature service endpoint and get all the features back as JSON response. As Esri GeoJSON is different from the common one, you need to translate the JSON response to the standard GeoJSON format, and then add to the feature collection in google maps Data Layer and apply styles.

This works if you have simple datasets. However if it is complex large polygon datasets, it will be causing network traffic when making the call. Also Google maps data layer always have performance issue when dealing with large dataset.

I recommend to use dojo/esri js API to develop the app if the data is hosted with ArcGIS server. It just doesn't make sense to buy both licenses for visualization.

Another option is to enable your ArcGIS online data to serve WMS layer too. Through that way your developer can use google maps overlay layer to overlay tiles from ArcGIS online. You can also make standard XMl request to the WMS service to get feature information.

Ok. You can convert to GeoJSON, but you're right, there's some big performance issues. I found the easiest solution to the problem was to rewrite all our Google Maps API using ESRI Leaflet. https://esri.github.io/esri-leaflet/ Leaflet is much easier to implement than the standard ESRI API. Didn't take long to rewrite and have the same functionality.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM