Front end - agencychief/iip-map GitHub Wiki

Located in /public directory

Build process (run in public directory):
npm install

Watch assets during development:
npm run dev

Build and minify assets for production:
npm run build

Important files and directories

/js/draw-map.js

File responsible for the map. The map markers pulled from a custom WP REST API endpoint /wp-json/iip-map/v1/maps/${mapId} where mapId is the Map Embed post ID.

/js/table/

React app used to display the map data in an alternative format.

embed-map.php

  • Localizes variables for consumption by map and table JS files.
  • Enqueues map and table JS and CSS.
  • Renders map and table HTML containers.