Sample code showing how to:
- create a TMS server, using the Elasticsearch vector tile search API.
- build a web-app using MapLibre, connecting to this TMS service.
This sample uses NodeJS. Install the runtime from NodeJS.
Install dependencies with npm
. npm is included with the NodeJS runtime.
npm install
Run an Elasticsearch instance. The sample code assumes it is running on the location stored in the ES_URL
environment variable or in http://localhost:9200
. Note: Hexagon aggregation requires a subscription or trial license.
To start the TMS server, run the node script. node
is included with the NodeJS runtime. It will start a server in localhost
and PORT
environment variable or 80
by default.
node ./index.js
To view the web page, just open up http://localhost:80
or http://localhost:{PORT}
browser.