I want to have locateMe button with static predefined x and y coordinates.

I have found this:

myWidget = new locateButton({
theme: "locateButton", // (optional). class name for the widget container. default: "locateButton"
map: myMap, // (required) map object. default: null.
visible: true, // (optional) show the widget. default: true.
highlightLocation: true, // (optional) show a graphic on the location when geolocated. default: true.
scale: null, // (optional) scale in meters to geolocate to. Defaults to accuracy from geolocation.
symbol: new PictureMarkerSymbol(require.toUrl("esri/dijit") + '/images/blue-dot.png', 21, 21), // (optional)
infoTemplate: null, // (optional) popup info template. default: null
useTracking: true, // (optional) use watchPosition instead of getCurrentLocation. default: false
setScale: true, // (optional) set scale on locate. default: true.
centerAt: true, // (optional) center at point on locate. default: true
geolocationOptions: // (optional). default: { maximumAge: 0, timeout: 15000, enableHighAccuracy: true}}, "locateButton");myWidget.startup();

But I can't make it run.

Any help how to achieve the LocateMe button with predefined values?


the locateButton widget is designed for retrieving the dynamic locations of end users using HTML5 geolocation.

if you want a button which centers the map on a static location, please check out the homeButton widget.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.