# Troubles with openlayers in ionic

**URL:** <https://forum.ionicframework.com/t/troubles-with-openlayers-in-ionic/142993>\
**Category:** Ionic Framework\
**Created:** [September 27, 2018, 12:47pm UTC](https://forum.ionicframework.com/t/troubles-with-openlayers-in-ionic/142993 "2018-09-27T12:47:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![blzblz](https://avatars.discourse-cdn.com/v4/letter/b/94ad74/32.png) [@blzblz](https://forum.ionicframework.com/u/blzblz)\
**Post date:** [September 27, 2018, 12:47pm UTC](https://forum.ionicframework.com/t/troubles-with-openlayers-in-ionic/142993/1 "2018-09-27T12:47:31Z")

</div>

Hi ionic people;

Noob with ionic, troubles trying to use openlayers (ol) with ionic display maps.

Versions:  
ionic@4.1.2  
npm list ionic -\> ol@5.2.0

Trying to run this demo (found in the thread " [Openlayers 4 Map control doesn’t work in Ionic](https://forum.ionicframework.com/t/openlayers-4-map-control-doesnt-work-in-ionic/107082)":

ionic serve ends with this error in browser:

Runtime Error:  
**WEBPACK\_IMPORTED\_MODULE\_2\_ol**.default is undefined

Stack:  
[394]/HomePage.prototype.loadmap@h t t p://localhost:8100/build/main.js:85:21 [394]/HomePage.prototype.ionViewDidEnter@h t t p://localhost:8100/build/main.js:68:9 ViewController.prototype.\_lifecycle@h t t p://localhost:8100/build/vendor.js:23299:13 ViewController.prototype.\_didEnter@h t t p://localhost:8100/build/vendor.js:23208:9 NavControllerBase.prototype.\_didEnter@h t t p://localhost:8100/build/vendor.js:64831:13 NavControllerBase.prototype.\_transitionFinish@h t t p://localhost:8100/build/vendor.js:64662:17 NavControllerBase.prototype.\_transitionStart/\</\<@h t t p://localhost:8100/build/vendor.js:64648:20 F\</l\</t.prototype.invoke@h t t p://localhost:8100/build/polyfills.js:3:14974 onInvoke@h t t p://localhost:8100/build/vendor.js:5134:24 F\</l\</t.prototype.invoke@h t t p://localhost:8100/build/polyfills.js:3:14901 F\</c\</r.prototype.run@h t t p://localhost:8100/build/polyfills.js:3:10124 NgZone.prototype.run@h t t p://localhost:8100/build/vendor.js:4951:54 NavControllerBase.prototype.\_transitionStart/\<@h t t p://localhost:8100/build/vendor.js:64647:50 F\</l\</t.prototype.invoke@h t t p://localhost:8100/build/polyfills.js:3:14974 onInvoke@h t t p://localhost:8100/build/vendor.js:5134:24 F\</l\</t.prototype.invoke@h t t p://localhost:8100/build/polyfills.js:3:14901 F\</c\</r.prototype.run@h t t p://localhost:8100/build/polyfills.js:3:10124 f/\<@ht t p://localhost:8100/build/polyfills.js:3:20240 F\</l\</t.prototype.invokeTask@h t t p://localhost:8100/build/polyfills.js:3:15649 onInvokeTask@h t t p://localhost:8100/build/vendor.js:5125:24 F\</l\</t.prototype.invokeTask@h t t p://localhost:8100/build/polyfills.js:3:15562 F\</c\</r.prototype.runTask@h t t p://localhost:8100/build/polyfills.js:3:10815 o@h t t p://localhost:8100/build/polyfills.js:3:7887

Ionic Framework: 3.9.2  
Ionic App Scripts: 3.2.0  
Angular Core: 5.2.11  
Angular Compiler CLI: 5.2.11  
Node: 8.11.4  
OS Platform: Linux x86\_64

I managed to run this leaflet demo:

> **[Ionic 3 – Multiple markers on maps with firestore (Part – 1)](http://tphangout.com/ionic-3-multiple-markers-on-maps-with-firestore-part-1/)**
>
> Hi Friends, Hope you are all well. In this post let’s see how to add multiple markers on your leaflet maps. We’ll also see how to store the  markers on firestore, retrieve and populate …

Then I updated it to a basic openlayers demo, but got same error as above ☹  
Any help greatly appreciated, thanks in advance !

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [July 19, 2021, 9:15pm UTC](https://forum.ionicframework.com/t/troubles-with-openlayers-in-ionic/142993/2 "2021-07-19T21:15:52Z")

</div>

Closed on July 19, 2021, 9:15pm UTC


