@opengis/gis 0.2.34 → 0.2.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengis/gis",
3
- "version": "0.2.34",
3
+ "version": "0.2.35",
4
4
  "type": "module",
5
5
  "author": "Softpro",
6
6
  "main": "./dist/index.js",
@@ -21,7 +21,9 @@ export default async function getMap({ params = {}, pg = pgClients.client }, rep
21
21
  const mapList = getTemplates('map').map(el => el[0]);
22
22
 
23
23
  const rows = pg.pk?.['gis.maps'] ? await pg.query(
24
- `SELECT map_id as id, *, config as widgets FROM gis.maps where ${params.id ? '$1 in (map_id,map_key)' : '1=1'}`,
24
+ `SELECT map_id as id, a.map_id, a.name, a.map_key,description,image,holder,keywords,is_public,is_active,zoom,srid,a.config as widgets,b.layers FROM gis.maps a
25
+ left join lateral (select json_agg(row_to_json(q)) as layers from (select service_id as id, *, st_asgeojson(bbox)::json as bbox, st_asgeojson(center)::json as center from gis.services where service_id = any(a.layers))q )b on true
26
+ where ${params.id ? '$1 in (a.map_id,a.map_key)' : '1=1'}`,
25
27
  [params.id].filter(Boolean),
26
28
  ).then(el => el.rows || []) : [];
27
29