Hello Geoff,
TL;DR Google Earth for Web does not geocode address like Google Earth Pro or My Maps.
There are ways around this. (See video below)
Usual disclaimers...
- I understand these are not eloquent solutions. The Earth team makes these.
- In typical Google fashion, these solutions work as of now, but I have know idea for how long. Only Google knows...or doesn't know...or can change their mind at any point. This is the way:)
- For the App script, I am not sure of the # limits Google has set for their geocoder function. At least for free use. There are ways to do this with their paid "places api". However, from my experience, this can get expensive for a teacher. I had to disable this API from my website because schools were constantly searching up locations via a search box; costing me hundreds of dollars. Probably part of the reason why the task you are trying to do is so cumbersome.
12 minute how to GeoCode Addresses from My Maps and Google Sheets
App Script
function GEOCODE_GOOGLE(address) {
if (address.map) {
return address.map(GEOCODE_GOOGLE)
} else {
var r = Maps.newGeocoder().geocode(address)
for (var i = 0; i < r.results.length; i++) {
var res = r.results[i]
return res.geometry.location.lat + "," + res.geometry.location.lng
}
}
}
Google Sheet Formula example
=if(ISBLANK(A2),,GEOCODE_GOOGLE(A2))
Please let me know if you need me to break this down any further or need any help with the lesson.
Have a great semester!
Josh