Method: geolocate
Activates the control.
353643
function (position) {
        var center = new OpenLayers.LonLat(
            position.coords.longitude,
            position.coords.latitude
        ).transform(
            new OpenLayers.Projection("EPSG:4326"),
            this.map.getProjectionObject()
        );
        if (this.bind) {
            this.map.setCenter(center);
        }
        this.events.triggerEvent("locationupdated", {
            position: position,
            point: new OpenLayers.Geometry.Point(
                center.lon, center.lat
            )
        });
    }
832478
function onChangeLocationBeginElement(event) {
    forwardGeocode(event.target.value, function (results, status) {
      if (status === window.google.maps.GeocoderStatus.OK && results.length) {
        locationBeginMarker.setPosition(new window.google.maps.LatLng(results[0].geometry.location.lat(), results[0].geometry.location.lng()));
      } else {
        log('onChangeLocationBeginElement:forwardGeocode failed', results, status);
      }
    });
  }
470464
public boolean onClickDefault(Polyline polyline, MapView mapView, GeoPoint eventPos) {
        polyline.setInfoWindowLocation(eventPos);
        polyline.showInfoWindow();
        return true;
    }
801555
@Activate
    protected void activate(BundleContext ctx, Map<String, Object> properties) {

        SibTr.entry(tc, CLASS_NAME + "activate", properties);

        this.properties = properties;
        this.bundleLocation = ctx.getBundle().getLocation();
        populateDestinationPermissions();
        runtimeSecurityService.modifyMessagingServices(this);

        SibTr.exit(tc, CLASS_NAME + "activate");

    }
83914
public void moveTo (ClientObject caller, int placeOid, LocationService.MoveListener listener)
        throws InvocationException
    {
        // do the move and send the response
        BodyObject body = _locator.forClient(caller);
        listener.moveSucceeded(moveTo(body, placeOid));
    }
6611
function(options){
      if (typeof window !== 'undefined' && window.navigator.geolocation) {

        // Have default options, but allow to extend with custom.
        var geolocationOptions = this.extend({
          maximumAge: 0,
          timeout: 10000,
          enableHighAccuracy: true
        }, options);

        return new Promise(function (resolve, reject) {

          window.navigator.geolocation.getCurrentPosition(function (position) {

            resolve(position);

          }, function (err) {

            var errorMessage = 'Geolocation: ';
            if(err.code === 1) {
              errorMessage = 'You didn\'t share your location.';
            } else if(err.code === 2) {
              errorMessage = 'Couldn\'t detect your current location.';
            } else if(err.code === 3) {
              errorMessage = 'Retrieving position timed out.';
            } else {
              errorMessage = 'Unknown error.';
            }
            reject(errorMessage);

          }, geolocationOptions);

        });

      }else{
        return new Promise(function (resolve, reject) {
          reject('Your browser\/environment doesn\'t support geolocation.');
        });
      }
    }
914811
public void onActivate() {
		menu = new Menu();
		menu.addItem(new CancelMeasuringAction(this));
		Layer selectedLayer = mapWidget.getMapModel().getSelectedLayer();
		if (selectedLayer instanceof VectorLayer) {
			menu.addItem(new ToggleSnappingAction((VectorLayer) selectedLayer, this));
		}
		mapWidget.setContextMenu(menu);
	}
1194881
def start_capture(self):
        """"""
        previous_map_tool = self.canvas.mapTool()
        if previous_map_tool != self.tool:
            self.previous_map_tool = previous_map_tool
        self.canvas.setMapTool(self.tool)
        self.hide()
223322
private void setPosition(float latitude, float longitude, boolean updateMap, boolean updateAddress) {

        m_editValue.setLatitude(latitude);
        m_editValue.setLongitude(longitude);
        m_popupContent.displayValues(m_editValue);
        if (updateMap) {
            updateMarkerPosition();
        }
        if (updateAddress) {
            updateAddress();
        }
    }
362103
function(options){
    if (options.enableEventLogging === false) return false;
    if (options.origin && options.origin.indexOf('api.mapbox.com') == -1) return false;
    // hard to make sense of events when a local instance is suplementing results from origin
    if (options.localGeocoder) return false;
    // hard to make sense of events when a custom filter is in use
    if (options.filter) return false;
    return true;
  }
1041401
function() {
        if (OpenLayers.Control.prototype.activate.apply(this, arguments)) {
            this.map.addLayer(this.gratLayer);
            this.map.events.register('moveend', this, this.update);     
            this.update();
            return true;            
        } else {
            return false;
        }
    }
157204
private boolean setLocation(String global, String context, Map<String, Object> properties) {
        String locationKey = "location." + context;
        Object propvalue = properties.get(locationKey);
        if (propvalue == null) {
            properties.put(locationKey, global);
        } else if (propvalue.getClass().isArray()) {
            Object[] locations = (Object[]) propvalue;
            if (ArrayUtils.contains(locations, global)) {
                return false;
            }
            Object[] newArray = Arrays.copyOf(locations, locations.length + 1);
            newArray[locations.length] = global;
            properties.put(locationKey, newArray);
        } else {
            if (((String) propvalue).equals(global)) {
                return false;
            }
            Object[] newArray = new Object[2];
            newArray[0] = propvalue;
            newArray[1] = global;
            properties.put(locationKey, newArray);
        }
        return true;
    }
1141862
public void activate() {
        // if no handlers are currently running, start one now
        if (this.numHandlersInFlight.getInt() == 0) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "Activating result handler: " + this.completionPort);
            }
            startHandler();
        }
    }
247599
function() {
        if(this.strategies) {
            var strategy, i, len;
            for(i=0, len=this.strategies.length; i<len; i++) {
                strategy = this.strategies[i];
                if(strategy.autoActivate) {
                    strategy.activate();
                }
            }
        }
    }
721904
function triggerGlobal(settings, context, eventName, data) {
        if (settings.global)
            return triggerAndReturn(context || document, eventName, data);
    }
664450
public boolean onClickDefault(Polygon polygon, MapView mapView, GeoPoint eventPos) {
		polygon.setInfoWindowLocation(eventPos);
		polygon.showInfoWindow();
		return true;
	}
159561
public void sendGeolocation(GeoLocation geoLocation)
            throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException, NotALeafNodeException {
        getNode().publish(new PayloadItem<GeoLocation>(geoLocation));
    }