console.log("hello from map.js") var hotelxy=[-19.8,47.5] var maxZoomLevel = 6 var tileSize = 256 var maxLenght = Math.pow(2, maxZoomLevel) * tileSize var mapNE = [maxLenght, 0] var mapSW = [0, maxLenght] var map = L.map('map', {'attributionControl': false}).setView(hotelxy,1); L.tileLayer('asset/tiles/{z}/{x}/{y}.png', { minZoom: 1, maxZoom: maxZoomLevel, continuousWorld: false, noWrap: true, crs: L.CRS.Simple, }).addTo(map); map.setMaxBounds(new L.LatLngBounds( map.unproject(mapSW, map.getMaxZoom()), map.unproject(mapNE, map.getMaxZoom()) )) console.log("getMaxZoom:") console.log(map.getMaxZoom()) var markPointerIcon = L.icon({ iconUrl: 'asset/markers/pointer.png', iconSize: [22, 32], iconAnchor: [11, 32], popupAnchor: [0, -38], }); var marker = L.marker(hotelxy, { icon: markPointerIcon, draggable : true, }).addTo(map); marker.bindPopup("check"); marker.on('click', function(e) { console.log("hello from marker") }) /* min/max = 163 map.setView([-163,-163],2) */