mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 02:56:41 +07:00
fixed dash on renderer
This commit is contained in:
parent
7b24499f49
commit
10d5fa1b98
1 changed files with 3 additions and 5 deletions
|
@ -29,8 +29,7 @@ const latLngToTile = (latlng: {
|
||||||
lat: number;
|
lat: number;
|
||||||
lng: number;
|
lng: number;
|
||||||
}): { x: number; y: number; z: number } => {
|
}): { x: number; y: number; z: number } => {
|
||||||
const map = MainMap;
|
const zoom = MainMap.getZoom();
|
||||||
const zoom = map.getZoom();
|
|
||||||
const xtile = Number(Math.floor(((latlng.lng + 180) / 360) * (1 << zoom)));
|
const xtile = Number(Math.floor(((latlng.lng + 180) / 360) * (1 << zoom)));
|
||||||
const ytile = Number(
|
const ytile = Number(
|
||||||
Math.floor(
|
Math.floor(
|
||||||
|
@ -48,8 +47,7 @@ const latLngToTile = (latlng: {
|
||||||
};
|
};
|
||||||
|
|
||||||
const tileToLatLng = (point: { x: number; y: number }): LatLng => {
|
const tileToLatLng = (point: { x: number; y: number }): LatLng => {
|
||||||
const map = MainMap;
|
const z = MainMap.getZoom();
|
||||||
const z = map.getZoom();
|
|
||||||
const lng = (point.x / Math.pow(2, z)) * 360 - 180;
|
const lng = (point.x / Math.pow(2, z)) * 360 - 180;
|
||||||
const n = Math.PI - (2 * Math.PI * point.y) / Math.pow(2, z);
|
const n = Math.PI - (2 * Math.PI * point.y) / Math.pow(2, z);
|
||||||
const lat = (180 / Math.PI) * Math.atan(0.5 * (Math.exp(n) - Math.exp(-n)));
|
const lat = (180 / Math.PI) * Math.atan(0.5 * (Math.exp(n) - Math.exp(-n)));
|
||||||
|
@ -209,7 +207,7 @@ export const composePoly = ({
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dash) {
|
if (dash) {
|
||||||
ctx.setLineDash([12, 12]);
|
ctx.setLineDash(dash);
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx.stroke();
|
ctx.stroke();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue