A custom element for use in your Aurelia applications for inserting Openlayers into your application.
This plugin is Work in Progess, defining his archicture and also his implementation. It's not ready to use in live/production enviroments.
Webpack/Aurelia CLI
npm install aurelia-openlayers --save
The Aurelia CLI requires some additional configuration to use this plugin. Open up your aurelia.json
file located in the aurelia_project
directory and at the bottom of the dependencies
section add in the following:
{
"name": "aurelia-openlayers",
"path": "../node_modules/aurelia-openlayers/dist/amd",
"main": "aurelia-openlayers"
}
Jspm
jspm install aurelia-openlayers
Inside of your main.js
/main.ts
file simply load the plugin inside of
the configure method using .plugin()
export function configure(aurelia: Aurelia) {
aurelia.use
.plugin('aurelia-openlayers', (config: AureliaOpenlayersConfiguration) => {});
}
Now you have Openlayers configured, to use it simply use the custom
element <ol-map></ol-map>
in your views.