Skip to content

Commit

Permalink
Update HTML pages (#7)
Browse files Browse the repository at this point in the history
* Add titles to configuration

* Update HTML ref
  • Loading branch information
webb-ben committed Aug 31, 2023
1 parent e479352 commit 2099f17
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,12 @@ <h6 class="m-0 font-weight-bold text-primary">

var items = new L.GeoJSON(geojson_data, {
onEachFeature: function (feature, layer) {
var url = '{{ data['items_path'] }}/' + feature.id + '?f=html';
var url;
if feature.properties.uri {
url = feature.properties.uri
} else {
url = '{{ data['items_path'] }}/' + feature.id + '?f=html';
}
var html = '<span><a href="' + url + '">' + {% if data['title_field'] %} feature['properties']['{{ data['title_field'] }}'] {% else %} feature.id {% endif %} + '</a></span>';
layer.bindPopup(html);
}
Expand Down
18 changes: 18 additions & 0 deletions pygeoapi.config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ resources:
user: ${POSTGRES_USER}
password: ${POSTGRES_PASSWORD}
id_field: huc2
title_field: name
table: hu02
uri_field: uri
geom_field: geom
Expand Down Expand Up @@ -145,6 +146,7 @@ resources:
name: PostgreSQL
data: *provider-data
id_field: huc4
title_field: name
table: hu04
uri_field: uri
geom_field: geom
Expand Down Expand Up @@ -174,6 +176,7 @@ resources:
name: PostgreSQL
data: *provider-data
id_field: huc6
title_field: name
table: hu06
uri_field: uri
geom_field: geom
Expand Down Expand Up @@ -203,6 +206,7 @@ resources:
name: PostgreSQL
data: *provider-data
id_field: huc8
title_field: name
table: hu08
uri_field: uri
geom_field: geom
Expand Down Expand Up @@ -232,6 +236,7 @@ resources:
name: PostgreSQL
data: *provider-data
id_field: huc10
title_field: name
table: hu10
uri_field: uri
geom_field: geom
Expand Down Expand Up @@ -275,6 +280,7 @@ resources:
name: PostgreSQL
data: *provider-data
id_field: nat_aqfr_cd
title_field: aq_name
table: nat_aq
uri_field: uri
geom_field: geom
Expand Down Expand Up @@ -310,6 +316,7 @@ resources:
name: PostgreSQL
data: *provider-data
id_field: aq_code
title_field: aq_name
table: princi_aq
uri_field: uri
geom_field: geom
Expand Down Expand Up @@ -348,6 +355,7 @@ resources:
name: PostgreSQL
data: *provider-data
id_field: id
title_field: shr
table: sec_hydrg_reg
uri_field: uri
geom_field: geom
Expand All @@ -372,6 +380,7 @@ resources:
name: PostgreSQL
data: *provider-data
id_field: id
title_field: description
table: ref_gages
uri_field: uri
geom_field: geom
Expand Down Expand Up @@ -399,6 +408,7 @@ resources:
name: PostgreSQL
data: *provider-data
id_field: id
title_field: name_at_outlet
table: mainstems
uri_field: uri
geom_field: geom
Expand Down Expand Up @@ -432,6 +442,7 @@ resources:
name: PostgreSQL
data: *provider-data
id_field: id
title_field: description
table: ref_dams
uri_field: uri
geom_field: geom
Expand Down Expand Up @@ -479,6 +490,7 @@ resources:
name: PostgreSQL
data: *provider-data
id_field: pwsid
title_field: pws_name
table: ref_pws
uri_field: uri
geom_field: geom
Expand Down Expand Up @@ -513,6 +525,7 @@ resources:
name: PostgreSQL
data: *provider-data
id_field: geoid
title_field: name
table: states
uri_field: uri
geom_field: geom
Expand Down Expand Up @@ -547,6 +560,7 @@ resources:
name: PostgreSQL
data: *provider-data
id_field: geoid
title_field: name
table: counties
uri_field: uri
geom_field: geom
Expand Down Expand Up @@ -574,6 +588,7 @@ resources:
name: PostgreSQL
data: *provider-data
id_field: geoid
title_field: name
table: aiannh
uri_field: uri
geom_field: geom
Expand Down Expand Up @@ -601,6 +616,7 @@ resources:
name: PostgreSQL
data: *provider-data
id_field: geoid
title_field: name
table: cbsa
uri_field: uri
geom_field: geom
Expand Down Expand Up @@ -631,6 +647,7 @@ resources:
name: PostgreSQL
data: *provider-data
id_field: geoid10
title_field: name10
table: ua10
uri_field: uri
geom_field: geom
Expand Down Expand Up @@ -665,6 +682,7 @@ resources:
name: PostgreSQL
data: *provider-data
id_field: geoid
title_field: name
table: places
uri_field: uri
geom_field: geom
Expand Down

0 comments on commit 2099f17

Please sign in to comment.