×

Notice

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

TOPIC: Directions problem

Directions problem 10 years 6 months ago #25936

  • Sergey
  • Sergey's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 23
  • Thank you received: 0
only with Perm in Query :( thats so bad for me

Directions problem 10 years 6 months ago #25949

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Well, we could try to check if Perm is present in the address, if it is, then we won't add it again.
if(departure.indexOf('Perm') == -1) {
			departure = departure + ',Perm'
		}
		if(arrival.indexOf('Perm') == -1) {
			arrival = arrival + ',Perm'
		}
		var request = {
			origin: departure,
			destination: arrival,
			travelMode: google.maps.DirectionsTravelMode.DRIVING
		};

Directions problem 10 years 6 months ago #25972

  • Sergey
  • Sergey's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 23
  • Thank you received: 0
so should i replace that code with yours
var request = {
origin: departure + ', Пермь',
destination: arrival + ', Пермь',
travelMode: google.maps.DirectionsTravelMode.DRIVING
};
couse if so, it does not work for me

Directions problem 10 years 6 months ago #25985

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
ah, so you have Пермь.
Good than the code should look like this one:
if(departure.indexOf('Perm') === -1  &&  departure.indexOf('Пермь') === -1) {
			departure = departure + ',Perm'
		}
		if(arrival .indexOf('Perm') === -1 && arrival .indexOf('Пермь') === -1) {
			arrival = arrival + ',Perm'
		}
		var request = {
			origin: departure,
			destination: arrival,
			travelMode: google.maps.DirectionsTravelMode.DRIVING
		};

Just replace the previous code with the above one and let me know if it works.

Regards,
Daniel

Directions problem 10 years 6 months ago #26008

  • Sergey
  • Sergey's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 23
  • Thank you received: 0

Directions problem 10 years 6 months ago #26011

  • Sergey
  • Sergey's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 23
  • Thank you received: 0
},
onHotspotsSearchDirection: function (departure, arrival) {
var self = this;

if(departure.indexOf('Perm') === -1 && departure.indexOf('Пермь') === -1) {
departure = departure + ',Perm'
}
if(arrival .indexOf('Perm') === -1 && arrival .indexOf('Пермь') === -1) {
arrival = arrival + ',Perm'
}
var request = {
origin: departure,
destination: arrival,
travelMode: google.maps.DirectionsTravelMode.DRIVING
};
// set the map each time we are searching for direction

Directions problem 10 years 6 months ago #26089

  • Sergey
  • Sergey's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 23
  • Thank you received: 0
so ive given a link with that version of sandbox.js

Directions problem 10 years 6 months ago #26123

  • Sergey
  • Sergey's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 23
  • Thank you received: 0
btw the problems is still exists, maybe we can just add "Пермь " in a fields?

Directions problem 10 years 6 months ago #26128

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Can I get ftp access to your site?

Directions problem 10 years 6 months ago #26129

  • Sergey
  • Sergey's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 23
  • Thank you received: 0
yes you are, but where is a PM on the forum

Directions problem 10 years 6 months ago #26132

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Just send me a mail & let me know once you do. Look down at the bottom of the site.

Directions problem 10 years 6 months ago #26133

  • Sergey
  • Sergey's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 23
  • Thank you received: 0

Message
Thank you for your email.


Used contact form

Directions problem 10 years 6 months ago #26142

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
try it now

Directions problem 10 years 6 months ago #26155

  • Sergey
  • Sergey's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 23
  • Thank you received: 0
:silly: :silly: :silly: it works! :side: :side: :side: ill buy sub soon! big thx!

Directions problem 10 years 5 months ago #26309

  • Sergey
  • Sergey's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 23
  • Thank you received: 0
so, was that only media\com_hotspots\js\sandbox.js ? or something else?

Directions problem 10 years 5 months ago #26310

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
just the sandbox.js
  • Page:
  • 1
  • 2
Time to create page: 0.122 seconds