Google Earth Widget

12-05-2017 03:35 PM
Labels (1)

Google Earth Widget

Google Earth Widget  (WAB 2.16) (Updated Dec 2019)

Here is a Google Earth Widget I created.  Street View can be accessed from here also, from the lower right corner of the window in Google Earth.

GitHub - kevinsagis/GoogleEarth: Google Earth Widget  

Demo link: Google Earth Widget Demo  

Update 2020: Google Earth now supports all browsers!

Labels (1)

kmsagis   I added to /blogs/myAlaskaGIS/2017/03/04/web-appbuilder-the-custom-widgets-list-332017?sr=search&searchId=77fba...‌ and the resource list.

Do you know whether this complies with the Goggle Terms of Service?

The Google Street View Image API Usage Limits policy is pretty generous. In the description of the service: "Most websites and applications may use the standard Google Street View Image API free of charge. A project is restricted to the complimentary per-day-limit of 25,000 map loads, unless you enable billing on the project. If billing is enabled on the project, the standard Google Street View Image API supports up to 100,000 map loads daily. If your website exceeds 25,000 map loads in a day, the API will cease to function for the rest of the day, unless you enable billing to access higher daily quota."

Pretty straightforward. For developers, the image API metadata requests are unlimited and are very useful in and of themselves.

Anonymous User

Rebecca Strauch, GISP‌ Thanks as always! I was thinking along Rudy's lines. I can pull if needed of course.  I was thinking since it opens a new tab that is unrelated it is alright. I have tried contacting them to no avail. Apparently you don't call them they call you. Unless it's for AdWords!  

Thanks Kevin and Rudy Stricklan     I'm certainly no expert on the TOS and only put the question out there since someone would eventually ask.         

I like the Widget, but...

I use a different spatial reference at startup.

WKID = 102722, 3734 Ohio State plane

Now when I select a point on the my map, Earth will open somewhere in Africa...

Can this be spatial issue be resolved?

Anonymous User

Hi Rich, great comment.

The code grabs the x,y...   pt = esri.geometry.webMercatorToGeographic(evt.mapPoint);

I have my viewers in web mercator as I was told a while ago by Esri API folks that it's quicker for viewers to use web mercator, and reproject our data, versus having viewers in state plane (which our data are all in on our SDE, too, GA St Plane), and force Esri's servers to reproject the basemap. So, they said using web mercator would be most optimal. It would be interesting to hear folks' experience with that though.  Nevertheless, many organizations will have differing projects. I'll make the code more universal and give an update.

That would be great!

I also do not use ESRI Base Maps, We have an E911 address assignment application for new addresses.

What I found out is that the official street names by legal design do NOT match the ESRI maps.

Our legal department would work a lot of overtime using ESRI Maps!

Just my 2 cents………

Thanks again!

Anonymous User

Rich, I gotcha.  Ours would too! We have a centerline and address layer maintained for dispatch. But most general purpose viewers use Esri basemaps because we are a Community Basemap city.  Do you upload your data to Esri Community Basemap Program? I recommend it. I'd been contemplating creating our own vector basemaps, but with their new vector basemaps like "Navigation" are so excellent I'll be going with that for most viewers. Navigation is sweet: Navigation Basemap

I am downloading and extracting the Google Earth widget to my client\stemap\widgets folder but when I go into an app to add the widget it is not showing up?

If you have an existing app then you will need to add it to server/apps/#/widgets folder as well

yes, but if I add it client/stemap then it should be available when I create a new app. right?

Anonymous User

George Katsambas‌ did you add it to your config file?  (Like in the example) Deploy your widget—Web AppBuilder for ArcGIS (Developer Edition) | ArcGIS for Developers  First add it to the Stem folder in stemapp or you can manually copy the widget in to your folder and add it to the config file which is in the root level of your app's folder, i.e. "3" in Server/Apps folder.  I will add it to the Stem folder in a future distro when I update the Git.

I installed the widget but  it freezes at   at the  " Google Earth. Loading in progress" screen.

When I checked online forums it was suggested to:

For the web version please ensure you have a 64 bit version of Chrome.
Then check the following:
  • WebGL has to be enabled in chrome://flags/#enable-es3-apis
  • "Use hardware acceleration when available" has to be checked in chrome://settings/search#hard
  • In chrome://flags select the first option "Override Software Rendering list"
Then restart Chrome.
UPDATE: I followed these steps and it works!
Has anyone experienced the freeze and follow the above steps to resolve the issue?

Any luck altering the projection issue in order to get me out of Africa?

Hi - We would love our internal GIS users to have access to something like this. In the past other widgets that link to Google Maps/Streetview appear to have been pulled as the breach the terms of the API (linking from a map to Streetview was against the terms?). Have Google changed their policy, or did previous discussions on here reach the wrong conclusion?

Hi Mark. I thought to insert my input. No, Google didn't change their TOS. However, if you use street view on Google Map, I believe you are not in a violation of TOS.  So, to avoid violating the TOS, I created a widget where when user select to use the street view, the widget will first change the current basemap to Google Street Map before you start using the tool. When the user select another basemap other than Google, then the StreetView tool becomes inactive.

I am still new to developing widgets and I am having the same issue, I go to add the widget and it is not in the list. I fixed it not showing up by creating a manifest.json. It now shows up in the widget list but when I click on it to configure it just tries to load forever and never shows anything to configure. I am super bummed because I think my coworkers would really enjoy this widget in our apps.

Anonymous User

Hi Cynthia Parker I just tested by downloading it and installing on a fresh WAB 2.7. It works here. To first add it, it must be added to the Stemapp folder. It is in \arcgis-web-appbuilder-2.7\WebAppBuilderForArcGIS\client\stemapp\widgets.  It should look like below (2.7) once all set. Then it should be in the Widget list to add. No need to add manually to the config or manifest at that point. Does this work for your setup? Let me know how it goes. I hope you and your team enjoy it!

Rich, I will take a look at the 3857 coordinate thing in a bit as well.


I am having the same issue as George. I download the widget placed the folder "GoogleEarth-master" in "C:\GIS API\WebAppBuilder2.7\WebAppBuilderForArcGIS\server\apps\11\widgets" and in "C:\GIS API\WebAppBuilder2.7\WebAppBuilderForArcGIS\client\stemapp\widgets". after adding the folders to the app and stemapp i don't see the widget on choose widget screen.

This is a common issue with people that are unfamiliar with GitHub and one of the reason I do not use it much.

You have to remove the "-master" portion of the folder before you add it to the stemapp widgets folder.

I did remove the -master after i copied the folders to the appropriate folders but no luck.

I deleted the fold in the mentioned folder above. removed the -master from the file i downloaded copied over the appropriate folders and saw this message.

{ message: 'Not existed:C:\\GIS API\\WebAppBuilder2.7\\WebAppBuilderForArcGIS\\client\\stemapp\\widgets\\GoogleEarth\\manifest.json' }.

I removed the folders and renamed the GoogleEarth-master to just GoogleEarth and copied the folders to the appropriate folders and i still can't see the widget.

I looked inside the widget folder and did not see manifest.json file.

Hmm.. Seems like Kevin did things a little different.

His GitHub Repository is a full WAB app and not just the widget.

So you have to go into the apps widgets folder and just extract the "Earth" widget folder. and place the "Earth" folder into the stemApps widgets folder.

The problem will persist. I downloaded previously the widget from the app as you suggested and it won't work. The issue is very well known among the Google Earth forums and the only way to resolve it, is to apply the changes to the Chrome browser as I indicated on a separate post. I tried those changes and it works! 

However, I chose not to include that widget in my app, since it will require the users to make changes in their browser. Not all users are inclined to make changes to their configurations, if they are not already restricted to do so from their own IT policy.

Anonymous User

Here is a link to just the widget folder. I also added it up at the top.  Just drop it in your stemapp folder. Then add to a specific viewer in Configuration as normally.  I'll revise the Git link in the long term and perhaps consider using a better way of downloading, like Robert does with the direct links.

Direct download link:  Download  


   Another thing to consider is that you are calling this the Google Earth widget and have your repository named that, yet the widget folder is expecting to be called Earth. That is very confusing for most people.

Kevin, why does this only work with Chrome?

Anonymous User

Keith, that is Google's intentional decision. 

Anonymous User

Keith Gerhartz‌ - so I looked in to it and Google will be adding universal browser support now that they are using Web Assembly!  

Google Earth is almost ready to work on Firefox  

Resources for Google Earth – Google Earth  

I'll update this the second I see they have support for shipping versions of Firefox, Safari and and IE.

I changed Google Earth widget which can do coordinate system projection from WKID 2881 to WKID 4326 since our map applications are using local projection system (WKID 2881). Here are the code changes. The code works in ArcGIS Enterprise 10.6.1. 

var outSpatialReference = new SpatialReference({
 wkid: 4326 //WGS 1984
var clickPoint = evt.mapPoint;
if (!projection.isSupported()) {
  console.error("Projection is not supported in the wbe browser");
projection.load().then(function () {
  var transformation = projection.getTransformation(clickPoint.spatialReference, outSpatialReference);
  var clickPointProjected = projection.project(clickPoint, outSpatialReference, transformation);
  url = "" + clickPointProjected.y + "," + clickPointProjected.x + EarthConfigURL;;

  ///// remove after one click
  ////remove after one click

Anonymous User

Lixin, great, and thanks for sharing!

2020 Update to all.....  Google Earth now supports all browsers!

Version history
Last update:
‎12-05-2017 03:35 PM
Updated by:
Anonymous User