It is currently Tue Nov 12, 2019 2:11 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 68 posts ]  Go to page Previous  1, 2, 3, 4, 5
Author Message
 Post subject: Re: Geolocation: Google Maps
PostPosted: Fri Jun 21, 2019 6:51 am 
Offline
User
User

Joined: Fri Mar 29, 2013 4:55 pm
Posts: 98
Location: Netherland
JHPJHP,

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

Little_man


Top
 Profile  
Reply with quote  
 Post subject: Geolocation: Google Maps
PostPosted: Fri Jun 21, 2019 8:25 am 
Offline
Addict
Addict
User avatar

Joined: Sat Oct 09, 2010 3:47 am
Posts: 1592
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.

_________________

I will be unreachable from the forum for an indefinite period; downloads moved to My PureBasic Stuff.
_________________


Last edited by JHPJHP on Fri Jun 21, 2019 5:27 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Geolocation: Google Maps
PostPosted: Fri Jun 21, 2019 3:03 pm 
Offline
User
User

Joined: Fri Mar 29, 2013 4:55 pm
Posts: 98
Location: Netherland
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


Top
 Profile  
Reply with quote  
 Post subject: Re: Geolocation: Google Maps
PostPosted: Fri Jun 21, 2019 3:35 pm 
Offline
Addict
Addict
User avatar

Joined: Tue Mar 02, 2004 1:20 pm
Posts: 1032
Location: Amphibios 9
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

_________________
Can't decide if i need a hug, an XXL coffee, 6 shots of vodka or 2 weeks of sleep.


Top
 Profile  
Reply with quote  
 Post subject: Re: Geolocation: Google Maps
PostPosted: Fri Jun 21, 2019 5:10 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Oct 09, 2010 3:47 am
Posts: 1592
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().

_________________

I will be unreachable from the forum for an indefinite period; downloads moved to My PureBasic Stuff.
_________________


Last edited by JHPJHP on Mon Jun 24, 2019 3:06 am, edited 2 times in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Geolocation: Google Maps
PostPosted: Sat Jun 22, 2019 7:35 am 
Offline
User
User

Joined: Fri Mar 29, 2013 4:55 pm
Posts: 98
Location: Netherland
JHPJHP

Problem has been resolved.

Little_man


Top
 Profile  
Reply with quote  
 Post subject: Re: Geolocation: Google Maps
PostPosted: Sun Jun 23, 2019 12:22 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Oct 09, 2010 3:47 am
Posts: 1592
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).

_________________

I will be unreachable from the forum for an indefinite period; downloads moved to My PureBasic Stuff.
_________________


Top
 Profile  
Reply with quote  
 Post subject: Re: Geolocation: Google Maps
PostPosted: Thu Jun 27, 2019 6:48 am 
Offline
Addict
Addict
User avatar

Joined: Sat Oct 09, 2010 3:47 am
Posts: 1592
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

_________________

I will be unreachable from the forum for an indefinite period; downloads moved to My PureBasic Stuff.
_________________


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 68 posts ]  Go to page Previous  1, 2, 3, 4, 5

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye