To create a minimal example using the Data Inspector Library map rendering, use a yeoman-based Web App Generator.
To get started, try installing and generating a web app that renders map data from a GeoJSON file:
Run the following commands in any command-line tool in an empty directory:
npm install --no-save --loglevel=error @here/generator-visualization-app
npx yo @here/visualization-app --force --china
--chinaoption in the command above to be able to access the China variant of the platform.
To install several sample applications with Web App Generator, use separate folders, and not nested subfolders. This way, sample applications are guaranteed to work correctly. If you still experience installation problems, make sure that there is no
.yo-rc.jsonfile (hidden) in the directories higher in the file structure.
Next, answer the questions in the command prompt:
Name your application:Type any name without whitespace, for example, my_app.
What kind of data will you visualize on top of the Base map?: If you are running this generator for the first time, choose the option
GeoJSON from a filein order to generate an application without any other questions.
Once the code is generated, you can build and serve the web app by running the following command:
npm run start
Info: Check the web app URL
When you run it for the first time, the web app is served under the URL
http://localhost:8080. However, if you run it again, the URL might be different. To be sure of the correct URL, check the console output:
Project is running at http://localhost:8080/
webpack output is served from /
Now that you have installed the web app generator, you are ready to run the basic app.