/// <summary> /// Returns a marker by its id /// </summary> /// <param name="mapId">Map Id</param> /// <param name="markerId">Marker Id</param> /// <returns>Marker</returns> public async Task <KartaMapNamedMarkerQueryResult> GetMarkerById(string mapId, string markerId) { if (string.IsNullOrEmpty(mapId) || string.IsNullOrEmpty(markerId)) { return(null); } string cacheId = mapId + "|" + markerId; if (_cachedMarkers.ContainsKey(cacheId)) { return(_cachedMarkers[cacheId]); } KartaMapNamedMarkerQueryResult markerQueryResult = await _mapDbAccess.GetMarkerById(mapId, markerId); _cachedMarkers.Add(cacheId, markerQueryResult); return(markerQueryResult); }
public async Task <IActionResult> GetMarker(string mapId, string markerId) { KartaMapNamedMarkerQueryResult marker = await _mapDbAccess.GetMarkerById(mapId, markerId); return(Ok(marker)); }