Page 5 of 5

Re: Geolocation: Google Maps

Posted: Fri Jun 21, 2019 6:51 am
by Little_man
JHPJHP,

A location with a ' gives an error (sample: 't hofke 1, Eindhoven)

Little_man

Geolocation: Google Maps

Posted: Fri Jun 21, 2019 8:25 am
by JHPJHP
Hi Little_man,

Thank you for posting your results.
Little_man wrote:A location with a ' gives an error (sample: 't hofke 1, Eindhoven)
That issue should have been fixed a few versions back, including numerous minor improvements and bug fixes.

Just in case, I recompiled the latest Windows examples; direct download available from my website.

Re: Geolocation: Google Maps

Posted: Fri Jun 21, 2019 3:03 pm
by Little_man
JHPJHP,

Start location: t Hofke 1, eindhoven, programma gives location: 't Hofke 30, 5641 AH Eindhoven, Nederland (this is correct zipcode).
End location: eindhoven, Nederland, programma gives: Eindhoven, Nederland.

Pushing the green arrow, information will be saved in database.
Then double click in the database that shows the SplashWindow and after a while I get a black window

Little_man

Re: Geolocation: Google Maps

Posted: Fri Jun 21, 2019 3:35 pm
by Kiffi
Little_man wrote:Pushing the green arrow, information will be saved in database.
This looks like a typical insert problem in connection with string concatenation.

myValue = "'t Hofke"

"INSERT INTO myTable (myColumn) VALUES ('" + myValue + "')"

Solution: Try doubling the apostrophe before the insert.

myValue = "'t Hofke"
myValue = ReplaceString(myValue, "'", "''")

(I hope you can recognize the fat red apostrophes.)

Greetings ... Peter

Re: Geolocation: Google Maps

Posted: Fri Jun 21, 2019 5:10 pm
by JHPJHP
Hi Little_man

The problem stems from Google Maps handling of some address' through some of its services.

Translating the address to latitude / longitude using an alternate Google Maps service seems to have fixed the problem.
- geolocation_autocomplete.pbi and geolocation_directions.pbi have been updated

Please test the updated examples to confirm that the problem has been resolved.

------------------------------------------------------

Hi Kiffi,

Thank you for your post.
Kiffi wrote:Solution: Try doubling the apostrophe before the insert.
Doubling a single-quote for SQL statements has already been written into the code; see Procedure DatabaseSetRow().

Re: Geolocation: Google Maps

Posted: Sat Jun 22, 2019 7:35 am
by Little_man
JHPJHP

Problem has been resolved.

Little_man

Re: Geolocation: Google Maps

Posted: Sun Jun 23, 2019 12:22 pm
by JHPJHP
Updated (Windows):
- added a language window
- added map styles
- couple minor improvements

Language Window
Selecting a language will close the window, reloading the current map in that language.
No database record is created until the current map is refreshed or a new map is retrieved.

Map Styles
Multiple JSON files can be associated to each example.
MapType name is taken from the JSON file name.
- text between string symbols (eg. \styles\geolocation_two_points$Retro$.json)

Map styles can be created from the following link: https://mapstyle.withgoogle.com/
Here is a site with over 1500 preconfigured map styles: https://snazzymaps.com/

NOTE
After upgrading to PureBasic 5.71 beta 2 LTS, the full screen Procedure needed modifying due to some aspect ratio issues.
Earlier versions of PureBasic may experience problems in full screen mode due to the recent changes (untested).

Re: Geolocation: Google Maps

Posted: Thu Jun 27, 2019 6:48 am
by JHPJHP
Updated (Windows):
- couple minor improvements
- couple bug fixes

Minor Improvements
Geolocation_Directions.pb:
- modified the directions algorithm
- added the option to remove the markers (Location List)
- added the option to change the line color (Location List)
- Saving the map will temporarily hide the map controls
Geolocation_IP_Address.pb:
- added the option to change the circle color (Location List)
- Saving the map will temporarily hide the map controls
Geolocation_Split_View.pb:
- various changes to improve the user experience
- Saving the map will temporarily hide the map controls
Geolocation_Two_Points.pb:
- added the option to change the line color (Location List)
- Saving the map will temporarily hide the map controls

Geolocation: Google Maps

Posted: Tue Dec 03, 2019 4:45 pm
by JHPJHP
Updated:
- fixed Geolocation_IP_Address.pb

Geolocation_IP_Address.pb
There was a format change to the IP-API XML download.

Re: Geolocation: Google Maps

Posted: Sun May 09, 2021 2:29 am
by JHPJHP
Updated:
- improved various parts of the code
- renamed some include files

Most of the updates were to the example Geolocation_Split_View.pb.
- updated version renamed to Geolocation_Split_View_1.pb
- original version renamed to Geolocation_Split_View_2.pb

While the Autocomplete "window" in the old version drew focus away from the main window, in the new version it acts more like a PureBasic Gadget.

NB*: Only the Windows package was updated.

Re: Geolocation: Google Maps

Posted: Sat Aug 07, 2021 7:37 pm
by JHPJHP
Updated (Windows package):
- some minor improvements
- squashed a couple bugs

Most changes were to the Split View examples.

NB*: Geolocation: Google Maps free executables were also updated.

Re: Geolocation: Google Maps

Posted: Tue Aug 10, 2021 8:41 pm
by JHPJHP
Updated (Windows package):
- added Prediction option to Split View example
- removed second Split View example
- various other improvements

Google Prediction Service
Previously the use of the Google Prediction Service was not optional, but I noticed with some locations (i.e. The Great Pyramid) a street address was returned instead of the actual request. The user now has the option to use or not use the Google Prediction Service for improved results.

NB*: Geolocation: Google Maps free executables were also updated.

Image

Re: Geolocation: Google Maps

Posted: Sat Sep 04, 2021 7:56 pm
by JHPJHP
Updated (Windows only):
- added User Agent to bypass Google API warning
- full screen control window lock transparency changed from double-click to right-click