yagajs / leaflet-ng2

Angular.io integration of Leaflet
https://leaflet-ng2.yagajs.org
ISC License
66 stars 26 forks source link

Does it work with Angular 4 CLI? #217

Closed mickeyjohn closed 7 years ago

mickeyjohn commented 7 years ago

Hi,

I am trying with an Angular 4 app but still could not get the map display. What I did are:

<yaga-map>
    <yaga-tile-layer [url]="'http://a.tile.openstreetmap.org/{z}/{x}/{y}.png'"></yaga-tile-layer>
</yaga-map> 

The map does not display then I got error message "Failed to load resource: net::ERR_INVALID_RESPONSE" in Chrome's console.

Any pointer is appreciated. Thanks.

atd-schubert commented 7 years ago

Maybe you have not give the map-component any size. You have to set this in css:

.yaga-map {
  min-height: 200px;
} 

BTW: You do not have to import leaflet.js in your angular-cli.json

atd-schubert commented 7 years ago

Maybe the solution in issue #216 should help you, too...