30 lines
782 B
JavaScript
30 lines
782 B
JavaScript
// variables
|
|
var mapZoom = getWidth() < 508 ? 5 : 6;
|
|
const MAP_ENDPOINT = "https://rmsmap.rmto.ir";
|
|
var bounds = [
|
|
[42.9130026312, 75.6166317076],
|
|
[20.5782370061, 30.5092252948],
|
|
];
|
|
// variables
|
|
// resize func
|
|
function getWidth() {
|
|
return Math.max(
|
|
document.body.scrollWidth,
|
|
document.documentElement.scrollWidth,
|
|
document.body.offsetWidth,
|
|
document.documentElement.offsetWidth,
|
|
document.documentElement.clientWidth
|
|
);
|
|
}
|
|
// end resize func
|
|
// map
|
|
var map = L.map("map", {
|
|
maxBounds: bounds,
|
|
minZoom: mapZoom,
|
|
zoomControl: false,
|
|
}).setView([32.42, 53.68], mapZoom);
|
|
L.tileLayer(MAP_ENDPOINT + "/141map/{z}/{x}/{y}.png", {
|
|
attributionControl: false,
|
|
attribution: "Open Street Map",
|
|
}).addTo(map);
|
|
// end map
|