Setting exact address (instead of coordinates)

Phoca Maps - displaying maps in Joomla! CMS
miracle
Phoca Newbie
Phoca Newbie
Posts: 9
Joined: 01 Oct 2013, 21:11

Setting exact address (instead of coordinates)

Post 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?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49138
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Setting exact address (instead of coordinates)

Post by Jan »

Hi, I think, this is more much a question on Google maps API developers :idea: Maybe there is some error when storing this address to map database :idea:

The javascript function displays markers but long and lat (longitude and latitude) but I am not sure if it can display it by address :idea:

Jan
If you find Phoca extensions useful, please support the project
miracle
Phoca Newbie
Phoca Newbie
Posts: 9
Joined: 01 Oct 2013, 21:11

Re: Setting exact address (instead of coordinates)

Post 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
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49138
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Setting exact address (instead of coordinates)

Post 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 :idea:
If you find Phoca extensions useful, please support the project
miracle
Phoca Newbie
Phoca Newbie
Posts: 9
Joined: 01 Oct 2013, 21:11

Re: Setting exact address (instead of coordinates)

Post 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...
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49138
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Setting exact address (instead of coordinates)

Post by Jan »

Hi, yes, all the markers are stored with longitude and latitude values (GPS)
If you find Phoca extensions useful, please support the project
miracle
Phoca Newbie
Phoca Newbie
Posts: 9
Joined: 01 Oct 2013, 21:11

Re: Setting exact address (instead of coordinates)

Post 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 ;-)
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49138
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Setting exact address (instead of coordinates)

Post 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 :idea:

This is why Phoca Maps stored lat and lng because then they are used to set the marker in Google Maps API.

Jan
If you find Phoca extensions useful, please support the project
miracle
Phoca Newbie
Phoca Newbie
Posts: 9
Joined: 01 Oct 2013, 21:11

Re: Setting exact address (instead of coordinates)

Post 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....
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49138
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Setting exact address (instead of coordinates)

Post 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. :idea:

Jan
If you find Phoca extensions useful, please support the project
Post Reply