NationalSecurityAgency/qgis-latlontools-plugin

Add Google Earth software as External Map Provider

jorgealmerio opened this issue · 10 comments

Please,

Add Google Earth software as External Map Provider to the settings, so we can use the tool "Show in External Map" to open Google Earth software at clicked place.

I have a potential solution to this, but am checking with Mac and Linux users to make sure it will work or not. Do you use Windows?

Yes, I use Windows!

I have this scheduled to work on next week.

Good news,

I have adapted (and ported to Qgis 3) the code from send2google_earth plugin (for Qgis 2).
The code is a little dirty, but maybe it be useful for your reference. See attachment (it's a python file).

send2google_earthtool.txt

Thanks! That is helpful. I am looking at these two calls

import os
import webbrowser
os.startfile('path to kml file')
webbrowser.open('path to kml file')

If you have some time try them in the QGIS python console to make sure they work. The first seems to be a windows only call. The second is making use of your default web browser to know how to handle the data. My biggest concern is to make this work on Linux and on Macs and the second option may be the best for these other OS. I will work on this next week and try to get a new release out.

I can not check on Linux and Mac, but I checked on Windows and both worked like a charm!!

Sorry for the delay!

I had some time today and added this feature. It is in version 3.1.15. Let me know how it works.

Yes, It works!
Thank you!
Good Job!

If you want to improve it more, you could place a temporary marker on Qgis too (remove after tool is deativated), I did it by adding a Rubber:

#Draw rubber point
r_pto = QgsVertexMarker(self.canvas)
r_pto.setCenter(point)

I also was trying to place a incremental temporary label beside each marker in Qgis without success.

I debated on this last request. Not everyone wants a marker so I decided to make it as an option in Settings. I am leaving it off by default, but if you go into Plugins->Lat Lon Tools->Settings and click on the External Map tab. Enable "Show marker on QGIS map" and then click on "OK". You will now see a marker where ever you click on the map. The setting will be persistent after you quite QGIS and then go back in.

This is in version 3.1.16

Checked here !!!
Very Good job !!!
We can close this issue if you want.