Display GeoJSON from URL Parameters
git clone https://github.com/nextgis/nglink.git
cd nglink
npm install
npm run dev-server
cd ./front
npm i
npm run prod
# or for development
npm run watch
Configure the map display by appending parameters to your application URL:
u
: URL of the GeoJSON data.color
: Fill color for the GeoJSON layer (default:blue
).bbox
: Bounding box inminLng,minLat,maxLng,maxLat
format.qmsid
: QMS ID for specific map services.fitoffset
: Offset for fitting the layer, formatwidth,height
or singlesize
.fitpadding
: Padding in pixels around the fitted layer.fitmaxzoom
: Maximum zoom level when fitting the layer.
Example URL:
https://show.nextgis.com/?u=https://data.nextgis.com/order/d6edd701/geometry&color=red&padding=50&fitpadding=10
Generates a PNG image of the map with the specified parameters.
- Parameters:
u
: URL of the GeoJSON data.color
: Fill color for the GeoJSON layer (default:blue
).bbox
: Bounding box inminLng,minLat,maxLng,maxLat
format.qmsid
: QMS ID for specific map services.fitoffset
: Offset for fitting the layer, formatwidth,height
or singlesize
.fitpadding
: Padding in pixels around the fitted layer.fitmaxzoom
: Maximum zoom level when fitting the layer.width
: Image width in pixels (default:400
).height
: Image height in pixels (default:200
).
Example:
GET /img?u=https://data.nextgis.com/order/d6edd701/geometry&color=green&width=800&height=600
Response:
- Returns a PNG image of the map.
Save Image Example:
curl "http://your-app-domain.com/img?u=https://data.nextgis.com/order/d6edd701/geometry&color=green&width=800&height=600" --output map.png
Ensure the following environment variables are set for backend functionality:
NGW_URL
: Base URL for NextGIS Web service.NGW_LOGIN
: NextGIS Web service login.NGW_PASSWORD
: NextGIS Web service password.NGW_UPLOAD_GROUP
: ID of the group for vector uploads.
docker build -t harbor.nextgis.net/frontend/nglink:latest .
docker run -it -p 3000:3000 --rm --name nglink harbor.nextgis.net/frontend/nglink:latest