Geolocation: Google Maps

Developed or developing a new product in PureBasic? Tell the world about it.
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: Geolocation via WebGadget

Post by JHPJHP »

Hi uweb,

Here are a couple things to look at: Geolocation.pb...

1. Does the first line in the ListIconGadget read [ status: success ] ?
2. REM the line [ WebBrowser2\put_Silent(#True) ] in the Procedure BuildMap.

Please let me know the results. Thank you.
uweb
User
User
Posts: 98
Joined: Wed Mar 15, 2006 9:40 am
Location: Germany

Re: Geolocation via WebGadget

Post by uweb »

Hi JHPJHP,

Yes, status is success.

With the REM I get a script-error in row 14 :
'google' is undefined
Code: 0
URL : about:blank

I did test https://developers.google.com/maps/docu ... les/?hl=de and the Samples do working in my IE11.
Please pardon my English, my native tongue is German.
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: Geolocation via WebGadget

Post by JHPJHP »

Hi uweb,

Geolocation.pb:
- it might be that MarkerText contains an invalid character; temporarily replace MarkerText with Double-Quotes in the Procedure SetScript.

Code: Select all

"['" + MarkerText + "'," + Latitude + "," + Longitude + "]"

"['" + "" + "'," + Latitude + "," + Longitude + "]"
uweb
User
User
Posts: 98
Joined: Wed Mar 15, 2006 9:40 am
Location: Germany

Re: Geolocation via WebGadget

Post by uweb »

Hi JHPJHP,

no, unchanged.
Please pardon my English, my native tongue is German.
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: Geolocation via WebGadget

Post by JHPJHP »

Hi uweb,

I've uploaded a new version of Geolocation via WebGadget, pointing the Include files (geolocation.pbi, etc.) to an alternate source script. Please let me know it this solves the problem.

Code: Select all

"<script src='https://maps.googleapis.com/maps/api/js?v=3&sensor=false' type='text/javascript'></script>"
If it still doesn't work, try changing https to http.

Thank you.
Last edited by JHPJHP on Sat Sep 24, 2016 11:07 pm, edited 2 times in total.
uweb
User
User
Posts: 98
Joined: Wed Mar 15, 2006 9:40 am
Location: Germany

Re: Geolocation via WebGadget

Post by uweb »

Hi JHPJHP,

sorry for the long time. I have visitors.

In comination with REM the line [ WebBrowser2\put_Silent(#True) ] I get now a message witch ask for execute the skript even though problem with saftey certificate.
If I choose Yes it works.
Please pardon my English, my native tongue is German.
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: Geolocation via WebGadget

Post by JHPJHP »

Hi uweb,

Thank you for working this out with me; whenever you have time is very much appreciated.

Have you tried changing https to http in the file Includes/geolocation.pbi?

Code: Select all

"<script src='https://maps.googleapis.com/maps/api/js?v=3&sensor=false' type='text/javascript'></script>"
uweb
User
User
Posts: 98
Joined: Wed Mar 15, 2006 9:40 am
Location: Germany

Re: Geolocation via WebGadget

Post by uweb »

Hi JHPJHP,

I thank you.
With http in place of https I get the same script-error like at the begin.

May I have to change the configuration of the IE.
I will try this tomorow.
Please pardon my English, my native tongue is German.
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: Geolocation via WebGadget

Post by JHPJHP »

Hi uweb,

There are many supported URL source script variations.
- so far all versions have worked on my Windows 10 and OSX computers without modification or prompt

I've uploaded a new version of Geolocation via WebGadget, pointing the Include files (geolocation.pbi, etc.) to an alternate source script. Please let me know it this solves the problem.

Code: Select all

"<script src='https://maps-api-ssl.google.com/maps/api/js?v=3&sensor=false' type='text/javascript'></script>"
If it still doesn't work, try using the following URL:

Code: Select all

https://maps.google.com/maps/api/js?v=3.5&sensor=false
Thank you.
uweb
User
User
Posts: 98
Joined: Wed Mar 15, 2006 9:40 am
Location: Germany

Re: Geolocation via WebGadget

Post by uweb »

Hi JHPJHP,

it is the same with both.

With

Code: Select all

#TAB$ + #TAB$ + "<script>if (navigator.geolocation) { var BrowserVersion = navigator.appVersion; window.clipboardData.setData('Text', BrowserVersion); alert(BrowserVersion); }</script>" + #LF$ +
I get
5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko

edit:
After insert the corresponding Domain (in my case : https://maps.google.com) to the trustworthily Sites in IE it works perfekt.

Thank you JHPJHP for your help and all your greate shared work!!!

PS
If you are looking for new challenge: Dokany (rebirth of dokan) is still waiting for a PB-Coder with more knowledge as my.
It offers more abilitys as ImDisk and in the meantime it is a signed Windows driver.
For example it would be posible to provide database-content dynamically as filesystem.
Please pardon my English, my native tongue is German.
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: Geolocation via WebGadget

Post by JHPJHP »

Hi uweb,

Thank you for reporting the issue and solving the problem :) I've added a note to the first post.

dokan-dev/dokany looks very interesting...
uweb
User
User
Posts: 98
Joined: Wed Mar 15, 2006 9:40 am
Location: Germany

Re: Geolocation via WebGadget

Post by uweb »

Hi JHPJHP,
I am sorry but I must cancel my solution.
Today in the morning it works. I am sure.
But now I get the message, witch ask for execute the skript even though problem with safety certificate, again.
I have tryed to reproduce the situation in the morning. But I am not able to make it work without this message.
Please pardon my English, my native tongue is German.
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: Geolocation via WebGadget

Post by JHPJHP »

Hi uweb,

Previously I modified the URL from maps.google.com to maps-api-ssl.google.com, could it be that the Trusted sites URL doesn't match the include file?

I've updated Geolocation via WebGadget with the original URL maps.google.com.
uweb
User
User
Posts: 98
Joined: Wed Mar 15, 2006 9:40 am
Location: Germany

Re: Geolocation via WebGadget

Post by uweb »

Hi JHPJHP,

probable this thought was the reason that I did changed yesterday falsely the include to 'https://maps.google.com'.

Now booth works with the Trusted sites 'https://maps.google.com' or 'https://maps.googleapis.com'. There is no difference.

Code: Select all

              ;#TAB$ + #TAB$ + "<script src='https://maps.googleapis.com/maps/api/js?v=3&sensor=false' type='text/javascript'></script>" + #LF$ +
              #TAB$ + #TAB$ + "<script src='https://maps.googleapis.com/maps/api/js?v=3.5&sensor=false' type='text/javascript'></script>" + #LF$ +
But it works without the images for the control elements over the map. There are only the placeholder ([x] left and middle - white area right).
Probably it was working yesterday also without them and i did not notice it.
Please pardon my English, my native tongue is German.
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: Geolocation via WebGadget

Post by JHPJHP »

Hi uweb,

Can you please try one last thing; download the latest version: Geolocation via WebGadget...

Before running the examples do the following:
- Internet Options -- General -- Delete
- Internet Options -- Security -- Trusted sites -- Sites
-- remove all entries, if it fails only add https://maps.googleapis.com
- Internet Options -- Security -- Reset all zones to default level
- Internet Options -- Advanced -- Restore advanced settings

Thank you :!:
Last edited by JHPJHP on Mon Sep 26, 2016 7:57 pm, edited 1 time in total.
Locked