The EasyGIS API is developed to enable the use of EasyGIS module as a widget in an external webpage. Usage of the EasyGIS API requires an API key. A key can be requested via info@easygis.eu.
To load the EasyGIS API, place the following code in the body
of your html document, preferably directly before the </body>
.
<script type="text/javascript" src="https://api.easygis.eu/js/latest.js">
With the EasyGIS API it is possible to load different modules.
This can be done using JavaScript by calling easygis.loadModule()
after loading the API.
The function easygis.loadModule()
requires a single argument - consisting of an object - which determines the desired configuration.
The following properties are required:
key
is the API-key provided by EasyGIS;uuid
is the specific widget Uuid provided by EasyGIS;module
determines which module to load;target
is the id of the HTML element into which the module should be loaded.<!DOCTYPE html> <html> <head> ... </head> <body> ... <div id="show-me-here"></div> ... <script type="text/javascript" src="https://api.easygis.eu/js/latest.js"></script> <script type="text/javascript"> easygis.loadModule({ key: 'ah5lf345yt274q2r234dq3464g563qy', uuid: '01234567-89ab-cdef-0123-456789abcdef', module: easygis.Module.MODULE, target: 'show-me-here' }); </script> </body> </html>
For the notification module use the following module
tag: easygis.Module.REPORTINGPOINT
.
... <script type="text/javascript"> easygis.loadModule({ ... module: easygis.Module.REPORTINGPOINT, ... }); </script>
For the planner use the following module
tag: easygis.Module.ROUTEPLANNER
.
... <script type="text/javascript"> easygis.loadModule({ ... module: easygis.Module.ROUTEPLANNER, ... }); </script>
A category must be specified using the category
tag. The following categories can are available:
easygis.Category.CYCLING
for cycling;easygis.Category.WALKING
for walking;easygis.Category.HORSERIDING
for horse riding & driving;easygis.Category.MOUNTAINBIKING
for mountain biking;easygis.Category.DRIVING
for driving;easygis.Category.BOATING
for boating.... <script type="text/javascript"> easygis.loadModule({ ... module: easygis.Module.ROUTEPLANNER, category: easygis.Category.CYCLING, ... }); </script>
The language in which the route planner is displayed can be set via the lang
tag. The following (ISO 639-1) codes are available:
"nl"
"en"
"de"
"fr"
... <script type="text/javascript"> easygis.loadModule({ ... key: '...', module: easygis.Module.ROUTEPLANNER, lang: "nl", ... }); </script>
You can specify a route code using the code
tag. A planned route or a thematic route code can be used.
... <script type="text/javascript"> easygis.loadModule({ ... key: '...', module: easygis.Module.ROUTEPLANNER, category: easygis.Category.CYCLING, code: 'abcde' ... }); </script>
A initial zoom level can be indicated using the zoom
tag (0 < zoom < 19
).
A specify an initial location to center the map can be specified using the center
tag.
The location must have a lat
and long
property in WGS84. Tip: Use Google Maps to easily find the coordinate of a location
... <script type="text/javascript"> easygis.loadModule({ ... module: easygis.Module.ROUTEPLANNER, category: easygis.Category.CYCLING, zoom: 11, center: {lat: 50.3, long: 5.1} ... }); </script>
For the POI widget module use the following module
tag: easygis.Module.POIWIDGET
.
... <script type="text/javascript"> easygis.loadModule({ ... key: '...', module: easygis.Module.POIWIDGET, ... }); </script>
A specific POI can specified using the uuid
tag. You can find the UUID in the management system.
... <script type="text/javascript"> easygis.loadModule({ ... key: '...', module: easygis.Module.POIWIDGET, uuid: 'a1b2c3d4-a1b2-a1b2-a1b2-a1b2c3d4e5f6' ... }); </script>
© 2022 EasyGIS