Local searches

54 views
Skip to first unread message

Matt

unread,
Dec 13, 2011, 1:01:42 PM12/13/11
to Google Maps JavaScript API v3
I hope someone can help. I have been trying to create a taxi fare
calculator for our new website using Google maps so I've been playing
around with some code. I have managed to create this (excuse the
styling I'm just trying to get the function right first)

http://www.shrewsburytaxiservice.co.uk/shrewsbury_taxi_service_local_taxi_shrewsbury_shropshire/taxi_fare_calculator_1.html

which has been simple enough using examples from Google tutorials but
what I want to do is make the start and end point editable by the
customer so they can enter a street name, town or postcode as well as
choosing from a pre-selected options list (i.e UK airports) and for
the route to then be calculated giving a result in miles. I don't
really need the directions box although I have included it for now as
it is the only way I have been able to get the distance calculated.
The resulting mileage can then be used to calculate the fare.

Hope that makes sense

Thanks

Barry Hunter

unread,
Dec 13, 2011, 2:29:28 PM12/13/11
to google-map...@googlegroups.com
Actually you do need to display the 'directions box'

The terms say you must display the results on a Google Map, or display
the whole text (which naturally includes the copyright message)

Other than that allowing the user to choose a location, or type. Is
not really a Maps API question. A common way to do that is with a
'combo' box.

The first result searching for "javascript combo box"
http://www.javascriptkit.com/script/cutindex16.shtml

> --
> You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
> To post to this group, send email to google-map...@googlegroups.com.
> To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.
>

Barry Hunter

unread,
Dec 13, 2011, 2:38:36 PM12/13/11
to google-map...@googlegroups.com
Hmm, seems my information was outdated

http://code.google.com/apis/maps/terms.html#section_10_1

10.1.1.(g). Says you cant even use it without a map. So just
displaying the text is no longer enough.


Cant find anywhere in the documentation that explicitly allows
displaying content without a map
http://code.google.com/apis/maps/documentation/javascript/services.html#Directions

See also
http://code.google.com/apis/maps/documentation/directions/#Limits

Matt Young

unread,
Dec 13, 2011, 2:44:39 PM12/13/11
to google-map...@googlegroups.com
I want to display the map and fine having the directions. How do I
make the start and end point user defined?

Sent from my iPhone

davie

unread,
Dec 14, 2011, 4:08:22 PM12/14/11
to Google Maps JavaScript API v3
Hi
Something like this http://daviestrachan.zxq.net/maps/taxicalc.html
works with address or Postcode
Regards Davie

On Dec 13, 7:44 pm, Matt Young <matty...@gmail.com> wrote:
> I want to display the map and fine having the directions. How do I
> make the start and end point user defined?
>
> Sent from my iPhone
>

> On 13 Dec 2011, at 19:39, Barry Hunter <barrybhun...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Hmm, seems my information was outdated
>
> >http://code.google.com/apis/maps/terms.html#section_10_1
>
> > 10.1.1.(g). Says you cant even use it without a map. So just
> > displaying the text is no longer enough.
>
> > Cant find anywhere in the documentation that explicitly allows
> > displaying content without a map

> >http://code.google.com/apis/maps/documentation/javascript/services.ht...
>
> > See also
> >http://code.google.com/apis/maps/documentation/directions/#Limits


>
> > On Tue, Dec 13, 2011 at 7:29 PM, Barry Hunter <barrybhun...@gmail.com> wrote:
> >> Actually you do need to display the 'directions box'
>
> >> The terms say you must display the results on a Google Map, or display
> >> the whole text (which naturally includes the copyright message)
>
> >> Other than that allowing the user to choose a location, or type. Is
> >> not really a Maps API question. A common way to do that is with a
> >> 'combo' box.
>
> >> The first result searching for "javascript combo box"
> >>http://www.javascriptkit.com/script/cutindex16.shtml
>

> >> On Tue, Dec 13, 2011 at 6:01 PM, Matt <matty...@gmail.com> wrote:
> >>> I hope someone can help. I have been trying to create a taxi fare
> >>> calculator for our new website using Google maps so I've been playing
> >>> around with some code. I have managed to create this (excuse the
> >>> styling I'm just trying to get the function right first)
>

> >>>http://www.shrewsburytaxiservice.co.uk/shrewsbury_taxi_service_local_...


>
> >>> which has been simple enough using examples from Google tutorials but
> >>> what I want to do is make the start and end point editable by the
> >>> customer so they can enter a street name, town or postcode as well as
> >>> choosing from a pre-selected options list (i.e UK airports) and for
> >>> the route to then be calculated giving a result in miles. I don't
> >>> really need the directions box although I have included it for now as
> >>> it is the only way I have been able to get the distance calculated.
> >>> The resulting mileage can then be used to calculate the fare.
>
> >>> Hope that makes sense
>
> >>> Thanks
>
> >>> --
> >>> You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
> >>> To post to this group, send email to google-map...@googlegroups.com.
> >>> To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.

> >>> For more options, visit this group athttp://groups.google.com/group/google-maps-js-api-v3?hl=en.

Matt Young

unread,
Dec 14, 2011, 5:00:35 PM12/14/11
to google-map...@googlegroups.com
That's perfect!! Can I use the code?

Thanks

Sent from my iPhone

davie

unread,
Dec 15, 2011, 6:09:06 AM12/15/11
to Google Maps JavaScript API v3
Hi
See http://daviestrachan.zxq.net/maps/taxicalc2.html
I have changed it for variable rates

Regards davie

On Dec 14, 10:00 pm, Matt Young <matty...@gmail.com> wrote:
> That's perfect!! Can I use the code?
>
> Thanks
>
> Sent from my iPhone
>

> On 14 Dec 2011, at 21:08, davie <daviestrac...@yahoo.co.uk> wrote:
>
>
>
>
>
>
>
> > Hi
> > Something like thishttp://daviestrachan.zxq.net/maps/taxicalc.html

Matt Young

unread,
Dec 15, 2011, 6:04:10 AM12/15/11
to google-map...@googlegroups.com
Hi,

This is great - thank you. Can I ask if there is a way to have
dropdown options such as heathrow airport and for that to produce a
fixed price?

I've put an option in for number of passengers as well as this effects
the price. If there are more than 4 people or if it is between 11pm
and 7am, there is a different rate. Is it possible to calculate based
on these variables?

Thanks

Sent from my iPhone

Matt Young

unread,
Dec 15, 2011, 6:10:14 AM12/15/11
to google-map...@googlegroups.com
Fantastic. I'll take a look later. You're a star!!

Sent from my iPhone

Matt

unread,
Dec 16, 2011, 3:29:12 AM12/16/11
to Google Maps JavaScript API v3
Hi again.

I can see how the variables for distance work but the real variables
are number of passengers and time of day and I can't see how to
include these. I've put a few time slots in and a number of passengers
option but how do I incorporate those into the fare calculation so if
someone wants a cab for 5 people at midnight, it uses rate3 but for 3
people at 9am it uses rate1?

Cheers.

On Dec 15, 11:10 am, Matt Young <matty...@gmail.com> wrote:
> Fantastic. I'll take a look later. You're a star!!
>
> Sent from my iPhone
>

> On 15 Dec 2011, at 11:09, davie <daviestrac...@yahoo.co.uk> wrote:
>
>
>
>
>
>
>
> > Hi
> > Seehttp://daviestrachan.zxq.net/maps/taxicalc2.html

Matt

unread,
Dec 16, 2011, 3:37:44 AM12/16/11
to Google Maps JavaScript API v3

Rossko

unread,
Dec 16, 2011, 4:35:39 AM12/16/11
to Google Maps JavaScript API v3
> I can see how the variables for distance work but the real variables
> are number of passengers and time of day and I can't see how to
> include these.

Does that have anything to do with maps? You might consider hiring a
developer for your commercial project.

Matt Young

unread,
Dec 16, 2011, 4:38:01 AM12/16/11
to google-map...@googlegroups.com
I already had an example using distance as a variable thro this forum
so thought it the best place to ask about other variables.

Sent from my iPhone

Reply all
Reply to author
Forward
0 new messages