×

Notice

The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: Directions problem

Directions problem 3 years 5 months ago #25760

  • Sergey
  • Sergey's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 23
  • Thank you received: 0
While im zooming my city (Russia, Perm)
i am trying to see direction from one address to another, but it zooms on whole country and shows me directions from other city to another city... but if i add the name of the city in my query it shows me right directions, so how to add name of the city to the script?
Thats why i can't start to use hotspots in my project :unsure

Directions problem 3 years 5 months ago #25761

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 154
  • Thank you received: 1081
So what? You are going to use directions only for 1 city now?
I think that you are out of luck with that.
developers.google.com/maps/documentation/javascript/directions
If for example the map was showing you 1 address in russia and one in ukraine, then we could use region biasing to set that the preferred results would be russian. But since both results are in russia I can't do anything.
Google map just tries to find the best match - and for some reason the best match is in another city. There is no other way than adding the city name in the query. The Problem with that is that if you add the city name to all query requests then users on your site won't be able to use the directions for anything else.
Regards,
Daniel

Directions problem 3 years 5 months ago #25764

  • Sergey
  • Sergey's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 23
  • Thank you received: 0
so i dont know what to do, couse its city portal, something like new variable with "cityname" goin from dropdown on site's frontend like:

Where are you from?
- Moscow
- Saint Petersburg
- Ekaterinburg

but if ill got nothin else, ill make search only for one city, and if ill go to other, ill make another sites with cityname subdomains. Just help a lil, which file should i rip? :D

Directions problem 3 years 5 months ago #25765

  • Sergey
  • Sergey's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 23
  • Thank you received: 0
BTW im doin a catalog of services and interesting places for one city now, other locations is not in focus now.

Directions problem 3 years 5 months ago #25768

  • Sergey
  • Sergey's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 23
  • Thank you received: 0
So, can anyone say which file runs that query? tryin to find it by myself but cant. id like to make it run the query with the city name by default.

Directions problem 3 years 5 months ago #25769

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 154
  • Thank you received: 1081
media\com_hotspots\js\sandbox.js - line 105:
var request = {
			origin: departure,
			destination: arrival,
			travelMode: google.maps.DirectionsTravelMode.DRIVING
		};
add your site to the origina and destination like this:
var request = {
			origin: departure + ',city name',
			destination: arrival + ',city name',
			travelMode: google.maps.DirectionsTravelMode.DRIVING
		};

Btw I don't think that what you try to do is correct. Even if you test it on maps.google.com - if I just enter 2 street names, then google is giving me directions between 2 cities. We cannot expect that it knows which streets you are referring to. That is why I as a user always add the city name to my search.

Directions problem 3 years 5 months ago #25779

  • Sergey
  • Sergey's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 23
  • Thank you received: 0
My site is for one city now, so user gona search (as my friends have tried) without pointing the city name, coz they think it gona search only their city.
maybe ill make a dropdown and something like different sandboxes for different city names (i dont know how it will) but the option to choose the city is important for me.

PS: Also, i can make a subdomains with city names like www.moscow.mysite.com and make index of mysite.com just a page with linked map like avito.ru

Thank you, and btw i can always turn this option off .


PSS: Some sites can view by IP which city i from (i think google too) and i dont know why it does not use that information

Directions problem 3 years 5 months ago #25780

  • Sergey
  • Sergey's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 23
  • Thank you received: 0
Also found a problem: when i am choosin an object on map and pressing on direction to that object, Hotspots asks me "From" which point im goin to the object and i am entering my address, so it is just showing me and address from default map point to my address. Not direction to the object from my address (but in the right menu it shows Right points) so i need to press "get direction" again but from the right menu and when it works

Directions problem 3 years 5 months ago #25781

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 154
  • Thank you received: 1081
I don't see this behavior on our demo site. The direction is rendered on the map and the directions are also shown in the menu on the right.

Regards,
Daniel

Directions problem 3 years 5 months ago #25789

  • Sergey
  • Sergey's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 23
  • Thank you received: 0
Okay, that happens with

origin: departure + ',city name',
destination: arrival + ',city name',

dat options only :(

Directions problem 3 years 5 months ago #25792

  • Sergey
  • Sergey's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 23
  • Thank you received: 0
so, when i am makin sandbox like that, direction for point workin good, but i am gettin my old problem back
origin: departure + ', Пермь',
destination: arrival,

When Hotspots popup opend i am pressin on direction and it shows me A and B points
A point set well, B point set at the default city point.

i think something wrong in hotspot.js

Directions problem 3 years 5 months ago #25860

  • Sergey
  • Sergey's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 23
  • Thank you received: 0
so it's still a problem :]

Directions problem 3 years 5 months ago #25864

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 154
  • Thank you received: 1081
What's the problem again? I'm not sure that I understand.

Directions problem 3 years 5 months ago #25866

  • Sergey
  • Sergey's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 23
  • Thank you received: 0
1st of all the problem turns on only with:
origin: departure + ',city name',
destination: arrival + ',city name',

how it looks?
i am clickin on hotspot, it pops up, so iam clickin on "direction" and it shows me default city point as point "B" (point A works good) the problem exists only in hotspot pop up, right menu is also workin good.

Directions problem 3 years 5 months ago #25867

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 154
  • Thank you received: 1081
can I see your site, I don't understand what you mean.

Directions problem 3 years 5 months ago #25869

  • Sergey
  • Sergey's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 23
  • Thank you received: 0
okay, look, try to find direction for that hotspot and look at point B
lookn.ru/index.php/geo.html#!/catid=18

Directions problem 3 years 5 months ago #25870

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 154
  • Thank you received: 1081
I still don't get it. I search for an address in the hotspot and it always work? It always finds the directions in the city of Perm?
Am I missing something?

Directions problem 3 years 5 months ago #25871

  • Sergey
  • Sergey's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 23
  • Thank you received: 0
Okay, i am showin a screenshots :)

lookn.ru/1.jpg

Directions problem 3 years 5 months ago #25904

  • Sergey
  • Sergey's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 23
  • Thank you received: 0
now have u got it? :)

Directions problem 3 years 5 months ago #25930

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 154
  • Thank you received: 1081
So, this happens only when you add the 'city name' to the query, or does it happen all the time with that particular hotspot?

Regards,
Daniel
  • Page:
  • 1
  • 2
Time to create page: 0.211 seconds