Geolocate

4204
4
Jump to solution
04-01-2015 02:28 PM
StanMcShinsky
Occasional Contributor III

Is there a way to make the MyLocation widget stay on so that it will follow you around as you are moving?

-Stan

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Stan,

   Sure just add "useTracking": true to the locateButton object in the config.json for the myLocate widget.

So the config.json will look like this:

{

  "locateButton": {

    "geolocationOptions": {

      "timeout": 15000

    },

    "highlightLocation": true,

    "useTracking": true

  }

}

View solution in original post

4 Replies
RobertScheitlin__GISP
MVP Emeritus

Stan,

   Sure just add "useTracking": true to the locateButton object in the config.json for the myLocate widget.

So the config.json will look like this:

{

  "locateButton": {

    "geolocationOptions": {

      "timeout": 15000

    },

    "highlightLocation": true,

    "useTracking": true

  }

}

StanMcShinsky
Occasional Contributor III

Thanks Robert I knew there was a parameter to add but I could not find it right off.

0 Kudos
williamcarr
Occasional Contributor II

Is there a way to toggle this on and off?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

William,

   Sure you just click the locate button again to turn it off, just like the standard LocateButton dijit in the JS API.