Skip to content

Commit

Permalink
Added Tel-Aviv, Haifa and Netanya
Browse files Browse the repository at this point in the history
  • Loading branch information
barak committed Aug 13, 2024
1 parent 28e4a70 commit 73c9378
Show file tree
Hide file tree
Showing 15 changed files with 396 additions and 356 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ module.exports = {
'vue/require-default-prop': 'off',
'vue/multi-word-component-names': 'off',
'vue/attribute-order': 'off',
'@typescript-eslint/no-explicit-any': 'off'
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': 'off'
}
}
7 changes: 2 additions & 5 deletions src/common/maps/govmap.data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,15 @@ import { MapData, UrlResult, UrlUsageType } from './map.data'
export const mapDataGovMap: MapData = {
name: 'GovMap',

urlProvider: async (usageType: UrlUsageType, mapType: string, zoomLevel: number, row: number, col: number): Promise<UrlResult> => {
urlProvider: async (_: UrlUsageType, mapType: string, zoomLevel: number, row: number, col: number): Promise<UrlResult> => {
if (mapType === '1:25000' && (zoomLevel < 5 || zoomLevel > 9)) {
return { url: '', unsupported: true }
}
const zoomLevelStr = (mapType === '1:25000' ? zoomLevel - 5 : zoomLevel).toString(10).padStart(2, '0')
const rowStr = row.toString(16).padStart(8, '0')
const colStr = col.toString(16).padStart(8, '0')
// https://cdn.govmap.gov.il/B0BZ1ORTO23/L08/R00004987/C00004114.jpg
// https://cdn.govmap.gov.il/B0b3010BLDG/L08/R00004986/C00004117.png
// https://cdn.govmap.gov.il/2024MAP25KTO/L03/R00004984/C00004115.png

const mapTypeStr = mapType === 'Satellite' ? 'B0BZ1ORTO23' : mapType === 'Street & Buildings' ? 'B0b3010BLDG' : '2024MAP25KTO'
const mapTypeStr = mapType === 'Satellite' ? 'B0BZ1ORTO23' : mapType === 'Street & Buildings' ? 'B0B0MARS27052024' : '2024MAP25KTO'
const suffix = mapType === 'Satellite' ? 'jpg' : 'png'
const domain = 'cdn.govmap.gov.il'
return {
Expand Down
244 changes: 122 additions & 122 deletions src/common/maps/haifa.data.ts
Original file line number Diff line number Diff line change
@@ -1,122 +1,122 @@
// import * as pimage from "pureimage";
// import { Bitmap } from "pureimage/types/bitmap";
// import { Readable } from "stream";
// import { MapData, UrlResult, UrlUsageType } from "./map.data";
//
// export const mapDataHaifa: MapData = {
// name: "Haifa",
//
// urlProvider: async (usageType: UrlUsageType, mapType: string, zoomLevel: number, row: number, col: number): Promise<UrlResult> => {
// let zoomLevelStr = zoomLevel.toString();
// const rowStr = row.toString();
// const colStr = col.toString();
// return { url: `https://gisserver.haifa.muni.il/arcgiswebadaptor/rest/services/Orthophoto_202204/MapServer/tile/${zoomLevelStr}/${rowStr}/${colStr}?blankTile=false` };
// },
//
// zoomLevelProvider: (zoomLevel: number): string => {
// return zoomLevel.toString();
// },
//
// zoomFactorProvider: (zoomLevel: number, zoomIn: boolean): number => {
// if (
// (zoomLevel === 0 && zoomIn) ||
// (zoomLevel === 1 && !zoomIn) ||
// (zoomLevel === 5 && zoomIn) ||
// (zoomLevel === 6 && !zoomIn)
// ) {
// return 1.5;
// // } else if (((zoomLevel === 3 || zoomLevel === 6) && zoomIn) || ((zoomLevel === 4 || zoomLevel === 7) && !zoomIn)) {
// // return 2.5;
// } else if ((zoomLevel === 3 && zoomIn) || (zoomLevel === 4 && !zoomIn)) {
// return 1.25;
// } else if ((zoomLevel === 4 && zoomIn) || (zoomLevel === 5 && !zoomIn)) {
// return 1.33;
// } else if ((zoomLevel === 7 && zoomIn) || (zoomLevel === 8 && !zoomIn)) {
// return 2.5;
// } else
// return 2;
// },
//
// decode: async (mapType: string, buffer: Buffer): Promise<Bitmap> => {
// return pimage.decodePNGFromStream(Readable.from(buffer));
// },
//
// supportedMapTypes: ["Satellite"],
//
// showScale: false,
//
// referer: undefined,
//
// zoomLayers: [
// {
// scale: 0,
// centerTileX: 1103,
// centerTileY: 1254,
// centerTileOffsetX: 30,
// centerTileOffsetY: 88,
// },
// {
// scale: 1,
// centerTileX: 1654,
// centerTileY: 1881,
// centerTileOffsetX: 178,
// centerTileOffsetY: 134,
// },
// {
// scale: 2,
// centerTileX: 3309,
// centerTileY: 3763,
// centerTileOffsetX: 98,
// centerTileOffsetY: 11,
// },
// {
// scale: 3,
// centerTileX: 6618,
// centerTileY: 7526,
// centerTileOffsetX: 199,
// centerTileOffsetY: 27,
// },
// {
// scale: 4,
// centerTileX: 8273,
// centerTileY: 9407,
// centerTileOffsetX: 118,
// centerTileOffsetY: 165,
// },
// {
// scale: 5,
// centerTileX: 11031,
// centerTileY: 12543,
// centerTileOffsetX: 72,
// centerTileOffsetY: 137,
// },
// {
// scale: 6,
// centerTileX: 16546,
// centerTileY: 18815,
// centerTileOffsetX: 237,
// centerTileOffsetY: 77,
// },
// {
// scale: 7,
// centerTileX: 33093,
// centerTileY: 37630,
// centerTileOffsetX: 216,
// centerTileOffsetY: 155,
// },
// {
// scale: 8,
// centerTileX: 82734,
// centerTileY: 94076,
// centerTileOffsetX: 154,
// centerTileOffsetY: 130,
// },
// {
// scale: 9,
// centerTileX: 165469,
// centerTileY: 188153,
// centerTileOffsetX: 51,
// centerTileOffsetY: 5,
// },
// ],
// };
import { MapData, UrlResult, UrlUsageType } from './map.data'

//https://experience.arcgis.com/experience/fbbaf8ced1a54fa394d47cdea28ca1b3
export const mapDataHaifa: MapData = {
name: 'Haifa',

urlProvider: async (_usageType: UrlUsageType, _mapType: string, zoomLevel: number, row: number, col: number): Promise<UrlResult> => {
if (zoomLevel < 3) {
return { url: '', unsupported: true }
}

const zoomLevelStr = zoomLevel.toString()
const rowStr = row.toString()
const colStr = col.toString()

return { url: `https://gisserver.haifa.muni.il/arcgiswebadaptor/rest/services/Orthophoto_202402/MapServer/tile/${zoomLevelStr}/${rowStr}/${colStr}?blankTile=false` }
},

zoomLevelProvider: (zoomLevel: number): string => {
return zoomLevel.toString()
},

zoomFactorProvider: (zoomLevel: number, zoomIn: boolean): number => {
if ((zoomLevel === 0 && zoomIn) || (zoomLevel === 1 && !zoomIn) || (zoomLevel === 5 && zoomIn) || (zoomLevel === 6 && !zoomIn)) {
return 1.5
// } else if (((zoomLevel === 3 || zoomLevel === 6) && zoomIn) || ((zoomLevel === 4 || zoomLevel === 7) && !zoomIn)) {
// return 2.5;
} else if ((zoomLevel === 3 && zoomIn) || (zoomLevel === 4 && !zoomIn)) {
return 1.25
} else if ((zoomLevel === 4 && zoomIn) || (zoomLevel === 5 && !zoomIn)) {
return 1.33
} else if ((zoomLevel === 7 && zoomIn) || (zoomLevel === 8 && !zoomIn)) {
return 2.5
} else return 2
},

supportedMapTypes: ['Satellite'],

showScale: false,

referer: undefined,

zoomLayers: [
{
scale: 0,
centerTileX: 1,
centerTileY: 1,
centerTileOffsetX: 1,
centerTileOffsetY: 1
},
{
scale: 1,
centerTileX: 1,
centerTileY: 1,
centerTileOffsetX: 1,
centerTileOffsetY: 1
},
{
scale: 2,
centerTileX: 1,
centerTileY: 1,
centerTileOffsetX: 1,
centerTileOffsetY: 1
},
{
scale: 3,
centerTileX: 1,
centerTileY: 1,
centerTileOffsetX: 132,
centerTileOffsetY: 205
},
{
scale: 4,
centerTileX: 3,
centerTileY: 3,
centerTileOffsetX: 6,
centerTileOffsetY: 152
},
{
scale: 5,
centerTileX: 6,
centerTileY: 7,
centerTileOffsetX: 10,
centerTileOffsetY: 47
},
{
scale: 6,
centerTileX: 12,
centerTileY: 14,
centerTileOffsetX: 17,
centerTileOffsetY: 93
},
{
scale: 7,
centerTileX: 24,
centerTileY: 28,
centerTileOffsetX: 34,
centerTileOffsetY: 188
},
{
scale: 8,
centerTileX: 48,
centerTileY: 57,
centerTileOffsetX: 66,
centerTileOffsetY: 119
},
{
scale: 9,
centerTileX: 96,
centerTileY: 114,
centerTileOffsetX: 132,
centerTileOffsetY: 239
},
{
scale: 10,
centerTileX: 193,
centerTileY: 229,
centerTileOffsetX: 5,
centerTileOffsetY: 222
}
]
}
9 changes: 6 additions & 3 deletions src/common/maps/map.data.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { mapDataGovMap } from './govmap.data'
import { mapDataTelAviv } from './tel-aviv.data'
import { mapDataHaifa } from './haifa.data'
import { mapDataNetanya } from './netanya.data'

export type ZoomLayer = {
readonly scale: number
Expand Down Expand Up @@ -33,9 +36,9 @@ export type MapData = {
export const maps = [
mapDataGovMap,
// mapDataGalilTahton,
// mapDataTelAviv,
// mapDataHaifa,
mapDataTelAviv,
mapDataHaifa,
// mapDataHodHasharon,
// mapDataNetanya,
mapDataNetanya,
// mapDataMapy
]
Loading

0 comments on commit 73c9378

Please sign in to comment.