fegyi001 / mangol

Maps created with Angular & OpenLayers using Material design
http://188.166.116.137/mangol/
98 stars 47 forks source link

Show Popup in Mangol #12

Closed jcendal closed 7 years ago

jcendal commented 7 years ago

I tried to show popups with the coordinates on the mangol map when clicking but I could not. Do you know any way to do it?

fegyi001 commented 7 years ago

Could you be more specific? E.g. code sample etc.

jcendal commented 7 years ago

yes sorry, i try to insert this example in my angular component with mangol map http://openlayers.org/en/latest/examples/overlay.html . Now i try insert it in container.component.ts. captura

fegyi001 commented 7 years ago

This is not an issue, just a simple use-case of Mangol which is quite doable.

But first of all, why do you use Mangol's source code instead of adding it as a dependency to your package.json? It is quite easy, just follow the Readme. Here I attach a working example solving your question. All you have to do is run npm install and then ng serve. mangol-test.zip

For this to work I imported a couple of libs into the index.html (bootstrap & jquery, because the OpenLayers example was built using them), then by modifying the app.component.ts and the app.component.scss everything works as expected.

Here is my result: untitled