Hello I was redirected to this forum to post my issue, here’s the content, Thank you for your time!
Short description of the problem:
Cannot use OpenLayers 3 with Ionic 2 RC1.
What behavior are you expecting?
Being to able to include OL into Angular Service.
Steps to reproduce:
Here’s how I include OL to my project:
- “openlayers”: “^3.19.1”,
- “@types/openlayers”: “^3.18.39”
- declare module ‘openlayers’;
And use it like this in my Angular service:
import ol from 'openlayers';
Which @ionic/app-scripts version are you using?
3.10.3
And here is what I get when I run “ionic serve”:
Uncaught SyntaxError: Unexpected identifier
Although it works when I replace the minified version of Ol “ol.js” with non-minified “ol-debug.js” in “node_modules”. I just switch the names. So the reason seems to be the build process where OL can’t access DOM objects.