APIs
Log In
APIs

TileLayer.getNearestGeometries

📘

Related REST API method

Take a look at getNearestGeometries.

TileLayer.getNearestGeometries(lat:Double, lng:Double, callback?:Function)

Returns a list of 10 (or less) geometries which are the nearest to the given coordinates, along with their properties and distance (in degrees) to the point.
Calls a callback function with the geometries if a callback parameter is given.

function onYoumapsApiLoaded(){
  console.log("YoumapsAPI loaded!");
  var mapdataLayer = youmapsApi.getMapdata(<MAPDATA_ID>);
  mapdataLayer.getNearestGeometries(48.858386, 2.343435, callback);
}

function callback(geometries){
	console.log("Retrieved following geometries " + geometries);
}

var mapOptions = {  
  center : new google.maps.LatLng(48.858386, 2.343435), // Paris,
  zoom : 11,
  minZoom : 6,
  maxZoom : 17
};

var youmapsApi = new YoumapsAPI(
  {
    techID : <YOUR_TECH_ID>, 
    initMapboards : true,
    mapDivId : "map",
    mapOptions : mapOptions
  },
  onYoumapsApiLoaded
);