yagajs / leaflet-ng2

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

map stays blank with gray #385

Closed ganigapeta closed 6 years ago

ganigapeta commented 6 years ago

I am trying to ad yaga leaflet basic map in my app, but it remains gray, below is my code snippet.

maps.component.html

<div class="widget map">
  <yaga-map
    [zoom]="17"
    [lat]="50.431782"
    [lng]="30.516382"
    [minZoom]="4"
    [maxZoom]="16">
    <yaga-zoom-control></yaga-zoom-control>
    <yaga-scale-control [metric]="true" [imperial]="false"></yaga-scale-control>
    <yaga-marker (click)="markerClick('click', $event);" [lat]="50.431782" [lng]="30.516382">
      <yaga-icon
        [iconUrl]="'./assets/marker-icon.png'"
        [iconSize]="[25, 41]"
        [iconAnchor]="[13, 41]"
        [shadowUrl]="'./assets/marker-shadow.png'"></yaga-icon>
        <yaga-popup>This is the content of the popup</yaga-popup>
    </yaga-marker>
    <yaga-tile-layer [(url)]="tileLayerUrl"></yaga-tile-layer>
  </yaga-map>   
</div>

maps.component.scss

.yaga-map { min-height: 100% }

maps.component.ts ... public tileLayerUrl: string = OSM_TILE_LAYER_URL; ...

capture

atd-schubert commented 6 years ago

Maybe just because you have a maxZoom of 16 and a zoom of 17?

atd-schubert commented 6 years ago

Otherwise, do you get any kind of error in your console of your browser?

ganigapeta commented 6 years ago

@atd-schubert I did not see any error in console, some how my component ngOnInit life hook not triggering on init. map working when i tried in new app. hope this is not error from library. Thanks!