navigator.geolocation
555688
function validate(harvested, report, next, options) {

    report.setChecklist('CodeUsage', 'Static code analysis');

    var illegalIdentifiers = ['geolocation'];

    function analyze(content, sourceURL, origin) {
        var ast;
        var trace = {
            'trace': {
                'sourceURL': sourceURL
            }
        };

        try {
            ast = esprima.parse(content.toString(), {
                'loc': true,
                'tolerant': true
            });
        } catch (e) {
            report.error('Possible javascript malformed / SyntaxError in content from ' + origin, {
                trace: [
                    {
                        'line': e.lineNumber,
                        'column': e.column,
                        'index': e.index,
                        'sourceURL': sourceURL
                    }
                ]
            });
            return;
        }

        estraverse.traverse(ast, {
            enter: function (node, parent) {
                if (node.type === 'Identifier' && parent.type === 'MemberExpression' && illegalIdentifiers.indexOf(node.name) > -1) {
                    report.error('Please do not "use" the geolocation api', trace);
                } else if (node.type === 'Literal' && illegalIdentifiers.indexOf(node.value) > -1) {
                    report.error('Please do not "use" the geolocation api', trace);
                }
            }
        });
    }

    if (harvested.script.tags) {
        harvested.script.tags.forEach(function (tag) {
            analyze(tag, options.scriptUrl, 'tag');
        });
    }

    if (harvested.script.attributes) {
        harvested.script.attributes.forEach(function (data) {
            data.matches.forEach(function (match) {
                analyze(match.value, '(' + data.tag + ') ' + match.key + '-attribute', 'attribute');
            });
        });
    }

    if (harvested.har.rawFileData) {
        Object.keys(harvested.har.rawFileData).forEach(function (key) {
            var v = harvested.har.rawFileData[key];
            if (v && !v.requestError && v.contentType && v.contentType.indexOf('javascript') > -1 && v.base64Content) {
                analyze(new Buffer(v.base64Content, 'base64').toString('utf8'), v.url, 'file');
            }
        });
    }

    report.exitChecklist();

    next();
}
546481
function LocationIQGeocoder(httpAdapter, apiKey) {

  LocationIQGeocoder.super_.call(this, httpAdapter);

  if (!apiKey || apiKey == 'undefined') {
    throw new Error('LocationIQGeocoder needs an apiKey');
  }

  this.apiKey = querystring.unescape(apiKey);
}
650112
def locationFromElement(self, element):
        
        elementLocation = None
        for locationElement in element.findall('.location'):
            elementLocation = self.readLocationElement(locationElement)
            break
        return elementLocation
1262199
function(location) {
			if (!location) {
				location = this._rootLocation;
			}
			return _call("PROPFIND", location, {depth:1}).then(function(response) {
				if (response.status !== 207) {
					throw "Error " + response.status;
				}
				
				var multistatus = parseDAV_multistatus(response.responseText);
				var childrenResponses = multistatus.response.slice(1);
				
				var children = [];
				while (childrenResponses.length !== 0) {
					children.push(createFile(childrenResponses.shift()));
				}
				return children;
			});
		}
1171071
function (req) {
                var location = getLocation(req),
                    href = location.origin + location.search;
                return href;
            }
738567
function doSearch() {
    var value = document.getElementById('search').value;
    marks = [];
    marksIndex = 0;
    for (var key in markers) {
        if ( (~(key.toLowerCase()).indexOf(value.toLowerCase())) && (mb.contains(markers[key].getLatLng()))) {
            marks.push(markers[key]);
        }
        if (markers[key].icon === value) {
            marks.push(markers[key]);
        }
    }
    moveToMarks();
    if (marks.length === 0) {
        // If no markers found let's try a geolookup...
        var protocol = location.protocol;
        if (protocol == "file:") { protocol = "https:"; }
        var searchUrl = protocol + "//nominatim.openstreetmap.org/search?format=json&limit=1&q=";

        fetch(searchUrl + value) // Call the fetch function passing the url of the API as a parameter
        .then(function(resp) { return resp.json(); })
        .then(function(data) {
            if (data.length > 0) {
                var bb = data[0].boundingbox;
                map.fitBounds([ [bb[0],bb[2]], [bb[1],bb[3]] ]);
                map.panTo([data[0].lat, data[0].lon]);
            }
            else {
                document.getElementById('searchResult').innerHTML = "&nbsp;<font color='#ff0'>Not Found</font>";
            }
        })
        .catch(function(err) {
            if (err.toString() === "TypeError: Failed to fetch") {
                document.getElementById('searchResult').innerHTML = "&nbsp;<font color='#ff0'>Not Found</font>";
            }
        });
    }
    else {
        if (lockit) {
            document.getElementById('searchResult').innerHTML = "&nbsp;<font color='#ff0'>Found "+marks.length+" results within bounds.</font>";
        } else {
            document.getElementById('searchResult').innerHTML = "&nbsp;<font color='#ff0'>Found "+marks.length+" results.</font>";
        }
    }
}
1372894
function getLocation(template, loc){
  if (loc)
    return (template.sourceUrl || '') + ':' + loc.start.line + ':' + (loc.start.column + 1);
}
1190196
function(){
      this.marker.setPosition(this.data.location);
      this.setDetail(this.details.lat, this.data.location.lat());
      this.setDetail(this.details.lng, this.data.location.lng());
    }
225737
private static Location scanLocations(List<Location> locations, LocationPredicate predicate) {
		Location location = null;
		for (Location l : locations) {
			if (location == null) {
				location = l;
			}
			else {
				if (predicate.accept(location, l)) {
					location = l;
				}
			}
		}
		return location;
	}
858083
function runGetFeature(callback) {
  var next = _.after(2, callback);
  function featureCallback(error, feature) {
    if (error) {
      callback(error);
      return;
    }
    if (feature.name === '') {
      console.log('Found no feature at ' +
          feature.location.latitude/COORD_FACTOR + ', ' +
          feature.location.longitude/COORD_FACTOR);
    } else {
      console.log('Found feature called "' + feature.name + '" at ' +
          feature.location.latitude/COORD_FACTOR + ', ' +
          feature.location.longitude/COORD_FACTOR);
    }
    next();
  }
  var point1 = {
    latitude: 409146138,
    longitude: -746188906
  };
  var point2 = {
    latitude: 0,
    longitude: 0
  };
  client.getFeature(point1, featureCallback);
  client.getFeature(point2, featureCallback);
}
80641
def location_check(lat, lon):
        """"""
        if not (isinstance(lat, number_types) and -90 <= lat <= 90):
            raise ValueError("Latitude: '{latitude}' invalid".format(latitude=lat))

        if not (isinstance(lon, number_types) and -180 <= lon <= 180):
            raise ValueError("Longitude: '{longitude}' invalid".format(longitude=lon))
176556
function runListFeatures(callback) {
  var rectangle = {
    lo: {
      latitude: 400000000,
      longitude: -750000000
    },
    hi: {
      latitude: 420000000,
      longitude: -730000000
    }
  };
  console.log('Looking for features between 40, -75 and 42, -73');
  var call = client.listFeatures(rectangle);
  call.on('data', function(feature) {
      console.log('Found feature called "' + feature.name + '" at ' +
          feature.location.latitude/COORD_FACTOR + ', ' +
          feature.location.longitude/COORD_FACTOR);
  });
  call.on('end', callback);
}
464697
function logWithLocation() {
					vLocation = vLocation
						|| sTarget && sPropertyName && sTarget + "/" + sPropertyName;
					return log.apply(this, arguments);
				}
891543
function ( feature, latlng ) {
				var Pin = L.marker.pin ( 
					latlng,
					{
						"text" : feature.properties.text,
						"phone" : feature.properties.phone,
						"url" : feature.properties.url,
						"distance" : feature.properties.distance,
						"address" : feature.properties.address,
						"pinCategory" : _Categories.getCategory ( feature.properties.categoryId ),
						"icon" : _Categories.getCategory ( feature.properties.categoryId ).CategoryIcon,
						"draggable" : true,
						"className" : 'Pin',
						"title" : _Categories.getCategory ( feature.properties.categoryId ).CategoryName,
					}
				);

				Pin.bindPopup ( Pin.getHtml ( ) );
				
				var ContextMenu;
				if ( typeof module !== 'undefined' && module.exports ) {
					ContextMenu = require ('./L.Marker.Pin.ContextMenu' );
				}
				else {
					ContextMenu = L.marker.pin.contextmenu;
				}
				
				Pin.on ( 'add', function ( event ) {this.options.map = event.target._map;} );
				Pin.on ( 'contextmenu', ContextMenu ); 
				Pin.on ( 'dblclick', ContextMenu);
				Pin.on ( 'dragend', this.CallbackFunction ); 
				
				this.push ( Pin );
				
				return Pin;
			}
521403
function(route, args) {
            url = urls.route(route, args);
            logging.log("navigate to ", url);
            window.location.hash = url;
            return this;
        }
545705
function getLocation(func) {
  const location = { ...func.location };

  // if the function has an identifier, start the block after it so the
  // identifier is included in the "scope" of its parent
  const identifierEnd = get(func, "identifier.loc.end");
  if (identifierEnd) {
    location.start = identifierEnd;
  }

  return location;
}
1000559
function() {

      var location = this.options.location, latLng;

      if (!location) { return; }

      if (typeof location == 'string') {
        this.find(location);
        return;
      }

      if (location instanceof Array) {
        latLng = new google.maps.LatLng(location[0], location[1]);
      }

      if (location instanceof google.maps.LatLng){
        latLng = location;
      }

      if (latLng){
        if (this.map){ this.map.setCenter(latLng); }
        if (this.marker){ this.marker.setPosition(latLng); }
      }
    }