better all on maps.
This commit is contained in:
1 parent
0da4c99d9f
commit
79da771597
1 file changed
+13
-3
@@ -1,9 +1,14 @@
|
|||||||
root = this;
|
root = this;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
mapCenter =
|
mapCenter =
|
||||||
lat: 46.1227
|
lat: 46.1227
|
||||||
lng: -72.6169
|
lng: -72.6169
|
||||||
zoom: 7
|
zoom: 7
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
getSingleDataUrl = (routeParams) ->
|
getSingleDataUrl = (routeParams) ->
|
||||||
url = "/api/#{ routeParams.server }/#{ routeParams.database }/#{ routeParams.collection }"
|
url = "/api/#{ routeParams.server }/#{ routeParams.database }/#{ routeParams.collection }"
|
||||||
if routeParams.query
|
if routeParams.query
|
||||||
@@ -21,14 +26,19 @@ getDocumentUrl = (routeParams, id) ->
|
|||||||
|
|
||||||
transformListOfGeoJsonToGeometryCollection = (resData, routeParams) ->
|
transformListOfGeoJsonToGeometryCollection = (resData, routeParams) ->
|
||||||
ret =
|
ret =
|
||||||
type: "GeometryCollection"
|
type: "FeatureCollection"
|
||||||
geometries: []
|
features: []
|
||||||
for doc in resData.document
|
for doc in resData.document
|
||||||
geojson = doc[routeParams.key]
|
geojson = doc[routeParams.key]
|
||||||
if not geojson.properties
|
if not geojson.properties
|
||||||
geojson.properties = {}
|
geojson.properties = {}
|
||||||
geojson.properties["_vulture_url_link"] = getDocumentUrl(routeParams, doc._id)
|
geojson.properties["_vulture_url_link"] = getDocumentUrl(routeParams, doc._id)
|
||||||
ret.geometries.push(geojson)
|
feature =
|
||||||
|
type: "Feature"
|
||||||
|
geometry: geojson,
|
||||||
|
properties:
|
||||||
|
"_vulture_url_link": getDocumentUrl(routeParams, doc._id)
|
||||||
|
ret.features.push(geojson)
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user