How to install Web App Generator for GeoJSON Files
Before you install the Web App Generator, make sure that your npm configuration is correct.
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-appand
npx yo @here/visualization-app --force
Note:
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 optionGeoJSON 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 -
Finally, open
http://localhost:8080in your favorite web browser to see the examples. To see the base map, enter the credentials that you obtained from the platform.
: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.
Updated 2 days ago