There are two methods:
- use # on <a href="#resten"> - on function $(document).ready() decode
URL adress to get data after # and then run method, which places
markers on map - main advantage of this method is that you can change
data after # dynamically without page reloading - for example on event
onchange assigned to select, so user can directly copy URL and forward
it (document.location = '#resten';).
- if you want use ?service=resten, then you can add (like to method
above) to $(document).ready() method to run action - but every change
of parameter needs page reload.
I have check your code and here is the sample for second method:
$(document).ready(function() {
var tmp = document.location.href.split('?');
if (tmp.length > 1) { // checking if there is question mark
tmp = tmp[1].split("=");
switch (tmp[1]) {
case 'resten': $('#service-type option').removeAttr
('selected'); $('#service-type option[value="brown"]').attr
('selected','selected'); toggleGroup("brown"); break;
// etc.
}
}
});
If you want to use more params (after &), then you have also split on
& and check which param is called 'service'.
Cheers,
Michal Biniek
On 15 Gru, 16:26, JJB <[email protected]> wrote:
> Hi,
>
> I inherited my site's google maphttp://www.gov.ns.ca/snsmr/offices.asp.
>
> Currently, it works fine. The "Select a service:" drop down is from a
> js.Once selected, it will populated the map with location and the next
> drop down "Select an office location:". The location are in an XML
> file.
>
> What I want to do is go directing to a location something like
> thishttp://www.google.com/maps?source=uds&q=restaurants&sll=43.742894,7.4....
>
> I can go directly to a
> servicehttp://www.gov.ns.ca/snsmr/offices.asp?service=resten.
>
> Thanks,'
> Jamie
--
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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-maps-js-api-v3?hl=en.