Skip to content

Commit

Permalink
Updates production Geoserver URL (#683)
Browse files Browse the repository at this point in the history
* Updates production Geoserver URL.

* Updates Geoserver URL to match correct location.

* Remove hard-coded GeoServer WFS URL and update README.

---------

Co-authored-by: Craig Stephenson <[email protected]>
  • Loading branch information
BobTorgerson and cstephen authored Jan 8, 2025
1 parent e66b3c5 commit fe1ab51
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 20 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ hydrated report pages.
The following environment variables can be set to change the API and map service
endpoints:

| Environment variable | Default |
| -------------------- | --------------------------------------- |
| GEOSERVER_URL | https://gs.mapventure.org/geoserver/wms |
| RASDAMAN_URL | https://zeus.snap.uaf.edu/rasdaman/ows |
| SNAP_API_URL | https://earthmaps.io |
| Environment variable | Default |
| -------------------- | -------------------------------------- |
| GEOSERVER_URL | https://gs.earthmaps.io/geoserver |
| RASDAMAN_URL | https://zeus.snap.uaf.edu/rasdaman/ows |
| SNAP_API_URL | https://earthmaps.io |

### Run locally in development mode

Expand Down
23 changes: 13 additions & 10 deletions components/Map.vue
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,19 @@ export default {
})
},
getBaseMapAndLayers() {
var baseLayer = new this.$L.tileLayer.wms(process.env.geoserverUrl, {
transparent: true,
srs: 'EPSG:3338',
format: 'image/png',
version: '1.3.0',
layers: [
'atlas_mapproxy:alaska_osm_retina',
'shadow_mask:iem_with_ak_aleutians_symmetric_difference',
],
})
var baseLayer = new this.$L.tileLayer.wms(
process.env.geoserverUrl + '/wms',
{
transparent: true,
srs: 'EPSG:3338',
format: 'image/png',
version: '1.3.0',
layers: [
'atlas_mapproxy:alaska_osm_retina',
'shadow_mask:iem_with_ak_aleutians_symmetric_difference',
],
}
)
// Projection definition.
var proj = new this.$L.Proj.CRS(
Expand Down
2 changes: 1 addition & 1 deletion nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export default {
// Env vars
env: {
geoserverUrl:
process.env.GEOSERVER_URL || 'https://gs.mapventure.org/geoserver/wms',
process.env.GEOSERVER_URL || 'https://gs.earthmaps.io/geoserver',
rasdamanUrl:
process.env.RASDAMAN_URL || 'https://maps.earthmaps.io/rasdaman/ows',
apiUrl: process.env.SNAP_API_URL || 'https://earthmaps.io',
Expand Down
7 changes: 4 additions & 3 deletions store/demographics.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ export const actions = {

// We query for the geometry of the place separately
let geometryQueryUrl =
"https://gs.mapventure.org/geoserver/wfs?service=WFS&version=1.0.0&request=GetFeature&typeName=demographics:demographics&outputFormat=application/json&cql_filter=id='" +
process.env.geoserverUrl +
"/wfs?service=WFS&version=1.0.0&request=GetFeature&typeName=demographics:demographics&outputFormat=application/json&cql_filter=id='" +
placeId +
"'"
let returnedGeometry = await $axios
Expand All @@ -87,11 +88,11 @@ export const actions = {
if (returnedData && returnedGeometry) {
// Make the data returns a bit more regular
let processed = _.mapValuesDeep(returnedData.data, (value, key) => {
if(key == 'total_population') {
if (key == 'total_population') {
// Skip this particular value.
return value
}
if(_.isNumber(value)) {
if (_.isNumber(value)) {
return Number.parseFloat(value).toFixed(1)
} else {
return value
Expand Down
2 changes: 1 addition & 1 deletion utils/maps.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const getBaseMapAndLayers = function () {
}
)
this.baseLayer = this.getBaseLayer()
let naturalEarth = new L.tileLayer.wms(process.env.geoserverUrl, {
let naturalEarth = new L.tileLayer.wms(process.env.geoserverUrl + '/wms', {
transparent: true,
format: 'image/png',
layers: 'natural_earth:iem-natural-earth',
Expand Down

0 comments on commit fe1ab51

Please sign in to comment.