PureBasic Forum
http://forums.purebasic.com/english/

Geolocation: Google Maps
http://forums.purebasic.com/english/viewtopic.php?f=12&t=66599
Page 5 of 5

Author:  Little_man [ Fri Jun 21, 2019 6:51 am ]
Post subject:  Re: Geolocation: Google Maps

JHPJHP,

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

Little_man

Author:  JHPJHP [ Fri Jun 21, 2019 8:25 am ]
Post subject:  Geolocation: Google Maps

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.

Author:  Little_man [ Fri Jun 21, 2019 3:03 pm ]
Post subject:  Re: Geolocation: Google Maps

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

Author:  Kiffi [ Fri Jun 21, 2019 3:35 pm ]
Post subject:  Re: Geolocation: Google Maps

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

Author:  JHPJHP [ Fri Jun 21, 2019 5:10 pm ]
Post subject:  Re: Geolocation: Google Maps

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().

Author:  Little_man [ Sat Jun 22, 2019 7:35 am ]
Post subject:  Re: Geolocation: Google Maps

JHPJHP

Problem has been resolved.

Little_man

Author:  JHPJHP [ Sun Jun 23, 2019 12:22 pm ]
Post subject:  Re: Geolocation: Google Maps

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).

Author:  JHPJHP [ Thu Jun 27, 2019 6:48 am ]
Post subject:  Re: Geolocation: Google Maps

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

Author:  JHPJHP [ Tue Dec 03, 2019 4:45 pm ]
Post subject:  Geolocation: Google Maps

Updated:
- fixed Geolocation_IP_Address.pb

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

Page 5 of 5 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/