Page 1 of 2
Setting exact address (instead of coordinates)
Posted: 18 Sep 2014, 12:14
by miracle
Hi, I'm trying to get this working: I want people to navigate to address 'huizermaatweg 1c huizen nl'. I made a marker using this information. But when I calculate the route at the frontend, it brings me to 'Huizermaatweg 41, 1273 NA Huizen, Nederland'. So the number is wrong (41 instead of 1).
I suppose this is because Phoca maps doesn't save the address I want, but only the coordinates. Is there a solution for this?
Re: Setting exact address (instead of coordinates)
Posted: 19 Sep 2014, 22:40
by Jan
Hi, I think, this is more much a question on Google maps API developers

Maybe there is some error when storing this address to map database
The javascript function displays markers but long and lat (longitude and latitude) but I am not sure if it can display it by address
Jan
Re: Setting exact address (instead of coordinates)
Posted: 20 Sep 2014, 10:36
by miracle
Hmmm, can't find an answer at Google. But when I try the same function (calculate driving directions to specific address) in Google Maps, it gets me to the right place (number 1C instead of 41 in the same street). See
https://www.google.nl/maps/dir/1411+BS+ ... 52.2974241
Re: Setting exact address (instead of coordinates)
Posted: 20 Sep 2014, 22:55
by Jan
This is really weird, because there are not two services, the Google Maps is only one service so if you run in in Phoca Maps, it is still Google Maps and searching is powered by Google Maps API

Re: Setting exact address (instead of coordinates)
Posted: 20 Sep 2014, 23:11
by miracle
But if I create a marker with your software, I suppose it's not saved as an address but as a set of coordinates. That might be the difference...
Re: Setting exact address (instead of coordinates)
Posted: 21 Sep 2014, 16:19
by Jan
Hi, yes, all the markers are stored with longitude and latitude values (GPS)
Re: Setting exact address (instead of coordinates)
Posted: 21 Sep 2014, 16:41
by miracle
Then I think that's the problem. This means the marker will be at the right place, but Google Maps will then try to determine what the address is of that specific location. That's where it goes wrong. Storing the address given by the user and use that as input to the Google Maps API when calculating a route would solve this problem. It's the second time I wasn't able to use your extension, because it's too confusing to let people calculate a route to number 1 when at the end of the route it says you arrived at number 41

Re: Setting exact address (instead of coordinates)
Posted: 21 Sep 2014, 18:08
by Jan
Hi, as written, I don't know, if there is such option in API, the standard displaying of marker is set by javascript in this way:
Code: Select all
mapPhocaMap = new google.maps.Map(document.getElementById('phocaMap'), phocaOptions);
var phocaPoint1 = new google.maps.LatLng(48.856614, 2.3522219000000177);
var markerPhocaMarker1 = new google.maps.Marker({
title:"Paris",
position: phocaPoint1,
map: mapPhocaMap
});
So the Lat, Lng is asked by Google Maps API
This is why Phoca Maps stored lat and lng because then they are used to set the marker in Google Maps API.
Jan
Re: Setting exact address (instead of coordinates)
Posted: 21 Sep 2014, 18:13
by miracle
In that case I don't know the answer. I only know when I do the calculation at the Google Maps website it works and with PhocaMpas it doesn't (no offense, I appreciate all the work you do!). I tried to find another site outside Google with route calculation and found this Dutch website:
http://www.kilometerafstanden.nl/google_maps.htm
They get it correct! So it must be possible. If you're interested I can contact them and ask for an explanation....
Re: Setting exact address (instead of coordinates)
Posted: 23 Sep 2014, 00:15
by Jan
Hi, then check the longitude and latitude values of the ones used on that site and compare it with yours. As I wrote, I or Phoca Maps does not decide where the marker will be displayed, it just stores the longitude and latitude values and then it sends them to Google Maps API which decides where the marker will be displayed.
Jan