Grab Transit Layer from Google Maps into AGOL Web Map?

1010
7
Jump to solution
02-27-2023 03:03 PM
Teresa_Blader
Occasional Contributor III

Is it possible to bring in the Transit Layer from Google Maps into an ArcGIS Online Web Map as an item or something? I see this example script on the Google Developers API site, but I know nothing about JavaScript really, where I would type it , or how to add it to a AGOL web map. We don't manage the transit data but it'd be really helpful to use in web maps or planning resource location analysis. 

function initMap() {
  const map = new google.maps.Map(document.getElementById("map"), {
    zoom: 13,
    center: { lat: 51.501904, lng: -0.115871 },
  });
  const transitLayer = new google.maps.TransitLayer();

  transitLayer.setMap(map);
}

window.initMap = initMap;

 source: https://developers.google.com/maps/documentation/javascript/examples/layer-transit#maps_layer_transi... 

Teresa Blader
Olmsted County GIS Specialist
0 Kudos
1 Solution

Accepted Solutions
james-noble
Esri Contributor

Hi @Teresa_Blader , It's certainly worth reviewing what's available here: OpenStreetMap (arcgis.com)

For example there's a 'live' OSM feature layer for North America which might be useful.

James Noble
Programme & Service Delivery @ Esri UK

View solution in original post

7 Replies
james-noble
Esri Contributor

Hi @Teresa_Blader , from what I can find I don't think this is possible with an out-of-the-box solution.

However, I wondered if the Esri layer 'Transportation' would be useful for you? It's available via here: https://services2.arcgis.com/FiaPA4ga0iQKduv3/arcgis/rest/services/Transportation_v1/FeatureServer 

jamesnoble_0-1678655648854.png

 

James Noble
Programme & Service Delivery @ Esri UK
0 Kudos
Teresa_Blader
Occasional Contributor III

Thanks for the reply. While we don't manage our bus transit lines, we do manage our own streets, so Esri's database is out of date in comparison to our centerlines, and also doesn't include transit lines 🙁

Teresa Blader
Olmsted County GIS Specialist
0 Kudos
james-noble
Esri Contributor

Hi @Teresa_Blader, sorry to hear that the Transportation layer isn't quite right. Ultimately it looks like using the Google Transit Layer is also against Google's Terms of Service (similar Community article here: Solved: Google maps in ESRI web application - Esri Community).

James Noble
Programme & Service Delivery @ Esri UK
0 Kudos
Teresa_Blader
Occasional Contributor III

Oh thanks for the info! Too bad. Granted no one cited the terms, it'd be nice to read those. Although it sounds like from that article, someone posted a comment on google maps api moving to arcgis api.... not sure how to make sense of that! Seems like Google doesn't have a problem using Esri products... just not the other way around. 

Teresa Blader
Olmsted County GIS Specialist
0 Kudos
Teresa_Blader
Occasional Contributor III

While I don't agree that a solution has been found, I wonder if there is a way instead to extract data (like bus stops, which would be a great alternative) from the OpenStreetMap? That is provided by Esri is it not?

Teresa Blader
Olmsted County GIS Specialist
0 Kudos
james-noble
Esri Contributor

Hi @Teresa_Blader , It's certainly worth reviewing what's available here: OpenStreetMap (arcgis.com)

For example there's a 'live' OSM feature layer for North America which might be useful.

James Noble
Programme & Service Delivery @ Esri UK
Teresa_Blader
Occasional Contributor III

That’ll do nicely! Thank you! 

Teresa Blader
Olmsted County GIS Specialist
0 Kudos