Display GeoJSON from URL Parameters
You need Bun installed.
brew tap oven-sh/bun
brew install buncurl -fsSL https://bun.sh/install | bashpowershell -c "irm bun.sh/install.ps1 | iex"Or via Scoop:
scoop install bunbun --versiongit clone https://github.com/nextgis/nglink.git
cd nglinkbun installbun run dev:serverRuns the backend at http://localhost:3000.
Production Build
bun run prodDevelopment build
bun run dev:frontBuilds and serves the frontend in watch mode.
cd ./front
bun run watchConfigure 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,maxLatformat.qmsid: QMS ID for specific map services.fitoffset: Offset for fitting the layer, formatwidth,heightor 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=10Generates 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).opacity: Fill opacity (default:0.6).strokeColor: Stroke color (default: uses the same value as color if not specified).strokeOpacity: Stroke opacity (default:1).bbox: Bounding box inminLng,minLat,maxLng,maxLatformat.qmsid: QMS ID for specific map services.fitoffset: Offset for fitting the layer, formatwidth,heightor 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=600Response:
- 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.pngEnsure 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 push harbor.nextgis.net/frontend/nglink:latest
# or
docker buildx bake
docker buildx bake --pushdocker run -it -p 3000:3000 --rm --name nglink harbor.nextgis.net/frontend/nglink:latest