Displays data from given sources on a leaflet map with multiple map layers.
Allows filtering on sources, and categories, from each source.
Displays related information in (responsive) popup from each marker.
Designed for integration in an iframe.
This project was generated with Angular CLI version 17.3.
npm i
Run ng serve
for a dev server. Navigate to http://localhost:4200/
. The application will automatically reload if you change any of the source files.
Run ng generate component component-name
to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module
.
Run ng build --configuration production --base-href=/tbmaps/
to build the project on production server. The build artifacts will be stored in the dist/
directory.
You will need to copy the content of the dist/tbmaps-angular/browser
on your server
You can use some parameters to customize the map :
sources
: the main source to display (evenements
by default, the other options aresentiers
andobservations
)logo
: an image url for your logo to be displayed on bottom left of the maptitre
: a title for your mapurl_site
: the link on your logo to your websitezoom
: an integer between 2 and 18 (the default zoom is7
)
To add some more custom parameters you will have to extend the app see Extend section below.
List of parameters you can use to filter observations :
referentiel
: filter by taxon referentielprojet
: filter by projecttaxon
: filter by taxon selected namenum_nom_ret
: filter by taxon id numberauteur
: filter by user (id or user e-mail)standard
:0
for non_standard data (1
by default if parameter is missing)
Run ng test
to execute the unit tests via Karma.
Run ng e2e
to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.
To get more help on the Angular CLI use ng help
or go check out the Angular CLI Overview and Command Reference page.
Default source is Tela-botanica (geolocated) post events called evenements (Évènements):
- Page : https://www.tela-botanica.org/evenements/.
- Service called (wp rest api) for 1000 results : http://localhost/site_tela/wp-json/wp/v2/posts?status=publish&categories=26,27,28,29&per_page=1000&order_by=modified&order=desc.
telabotanica/wp-theme-telabotanica
-
Check that requested categories ids in query string are all the children of category evenements (currently category evenement id is "25", requested categories are "26" to "29").
-
Loading 1000 post events can be long 🐢 and may fail so :
- make sure that wp-content/themes/telabotanica/inc/rest-api-posts-per-page.php exists and registered in functions.php (alows param
per_page
to request more than 100 results) - Make sure the WP REST Cache plugin is installed, active and properly configured
- To load 1000 post events it may be necessary to prime the cash by runing the request separately in a browser several times or try to load less data (800 or 500 seems to work). And roll the dice 🎲.
Note that :
* you may have to delete some cash records during the process : unsuccessful requests may have been cashed
* after the request succeeds, delete all other request from the cash
* sometimes when the cash times out you have to repeat this operation from the beginning
- Some custom fields are required in the returned data :
- A field category listing category id, name and slug : make sure that wp-content/themes/telabotanica/inc/rest-api-posts-category-hierarchy.php exists and registered in functions.php
- A field acf Advanced Custom Fields, acf meta data object of the post : make sure that wp-content/themes/telabotanica/inc/rest-api-posts-acf.php exists and registered in functions.php