tombatossals/angular-leaflet-directive

Map is not showing(Grey color) properly in ionic

Closed this issue · 6 comments

I am using ionic and angularjs to show map with marker. It is working properly in browser or emulator but not properly showing(Grey color) in android device.

what's wrong I don't know?

I solve this problem. So I am closing this issue

How did u fix this issue?

Sorry I can't explain here.

Thats fine. I managed to fix. In my case I forgot to specify tiles property for map. I have added my code below which might help for someone.

            <leaflet id="drawingMap" defaults="map.defaults" watch-paths="false" data-tap-disabled="true" marker-options="markerOptions" event-broadcast="map.events" center="map.center" markers="map.markers" bounds="map.bounds" tiles="map.tiles" ng-if="map"></leaflet>

$scope.map = {
defaults: {
zoomControl: false
},
tiles: {
url: 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'
},
bounds: {},
markers: {},
center: {
lat: defaultCenter.latitude, // This is current location of user. required for my case.
lng: defaultCenter.longitude,
zoom: 10
},
events: {
map: {
enable: ["zoomend", "dragend", "popupclose", "mouseover", "mouseout", "click", "popupopen"],
logic: 'emit'
}
}
};

kl