Not quite:

// Safari supports the W3C Geolocation method
 if(navigator.geolocation) {
   navigator.geolocation.getCurrentPosition(function(position) {
     initialLocation = new
google.maps.LatLng(position.coords.latitude,position.coords.longitude);
     var placeMarker = new google.maps.Marker({
       position: initialLocation,
       map: map
     });
     map.setCenter(initialLocation);
   }, function() {
     handleNoGeolocation(browserSupportFlag);
   },  { 'maximumAge': 0 });

Chad Killingsworth

On May 13, 12:13 pm, Jack Berberette <[email protected]> wrote:
> Thanks Chad...
>
> So would I change my code from:
>
> // Safari supports the W3C Geolocation method
>  if(navigator.geolocation) {
>    navigator.geolocation.getCurrentPosition(function(position) {
>      initialLocation = new
> google.maps.LatLng(position.coords.latitude,position.coords.longitude);
>      var placeMarker = new google.maps.Marker({
>        position: initialLocation,
>        map: map
>      });
>      map.setCenter(initialLocation);
>    }, function() {
>      handleNoGeolocation(browserSupportFlag);
>    });
>
> To:
>
> // Safari supports the W3C Geolocation method
>  if(navigator.geolocation) {
>    navigator.geolocation.getCurrentPosition(show_position,
> handleLocationError, { 'enableHighAccuracy': true, 'maximumAge': 0 },
> function(position) {
>      initialLocation = new
> google.maps.LatLng(position.coords.latitude,position.coords.longitude);
>      var placeMarker = new google.maps.Marker({
>        position: initialLocation,
>        map: map
>      });
>      map.setCenter(initialLocation);
>    }, function() {
>      handleNoGeolocation(browserSupportFlag);
>    });
>
> On Thu, May 13, 2010 at 12:59 PM, Chad Killingsworth <
>
>
>
>
>
> [email protected]> wrote:
> > > Is it possible to add an onClick button that will "get" the user's
> > current
> > > location?  I have my map running on the iPhone and at (
> >http://www.gamecarver.com/viperapp.html) but sometimes the current
> > location
> > > seems "cached".
>
> > getCurrentPosition takes 3 arguments - it's the third that will set
> > this. Here's a sample - maximumAge is what you want:
>
> > navigator.geolocation.getCurrentPosition(show_position,
> > handleLocationError, { 'enableHighAccuracy': true, 'maximumAge': 0 });
>
> > > Also...is it possible to move the "Map, Satellite, Hybrid, Terrain"
> > > toolbar...or even disable it?
>
> > Move:
> > new google.maps.Map(mapDiv, {mapTypeControlOptions: {position:
> > google.maps.ControlPosition.BOTTOM_LEFT} });
>
> > Disable:
> > new google.maps.Map(mapDiv, {mapTypeControl: false });
>
> > Chad Killingsworth
>
> > --
> > 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]<google-maps-js-api-v3%2B 
> > [email protected]>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-maps-js-api-v3?hl=en.
>
>  PR: wait... <javascript:{}> I: wait... <javascript:{}> L:
> wait...<javascript:{}> LD:
> wait... <javascript:{}> I: wait... <javascript:{}>wait... <javascript:{}> 
> Rank:
> wait... <javascript:{}> Traffic: wait... <javascript:{}> Price:
> wait...<javascript:{}> C:
> wait... <javascript:{}>
>
> --
> 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 
> athttp://groups.google.com/group/google-maps-js-api-v3?hl=en.

-- 
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.

Reply via email to