You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
155 lines
4.8 KiB
155 lines
4.8 KiB
import L from 'leaflet' |
|
import 'leaflet-bing-layer' |
|
const tgl = new Date() |
|
|
|
const thn = tgl.getFullYear() |
|
const BING_KEY = 'AuhiCJHlGzhg93IqUH_oCpl_-ZUrIE6SPftlyGYUvr9Amx5nzA-WqGcPquyFZl4L' |
|
export const bing_ae_opt = { |
|
attribution: 'Base Map : <a href="https://www.microsoft.com/en-us/maps/product/print-rights">Microsoft Bing</a>', |
|
bingMapsKey: BING_KEY, |
|
imagerySet: 'Aerial', |
|
culture: 'id-ID', |
|
minZoom: 1, |
|
maxZoom: 23, |
|
minNativeZoom: 1, |
|
maxNativeZoom: 20 |
|
} |
|
|
|
export const bing_r_opt = { |
|
attribution: 'Base Map : <a href="https://www.microsoft.com/en-us/maps/product/print-rights">Microsoft Bing</a>', |
|
bingMapsKey: BING_KEY, |
|
imagerySet: 'Road', |
|
culture: 'id-ID', |
|
minZoom: 1, |
|
maxZoom: 30, |
|
minNativeZoom: 1, |
|
maxNativeZoom: 30 |
|
} |
|
|
|
const Road = L.tileLayer('https://mt{s}.google.com/vt/lyrs=m&x={x}&y={y}&z={z}', { |
|
attribution: `Map data ©${thn} <a href="https://www.google.com/intl/id_id/help/terms_maps/">Google</a>`, |
|
maxZoom: 30, |
|
minZoom: 1, |
|
tileSize: 256, |
|
zoomOffset: 0, |
|
noWrap: false, |
|
subdomains: '0123', |
|
accessToken: '' |
|
}) |
|
|
|
const Road_Preview = L.tileLayer('https://mt{s}.google.com/vt/lyrs=m&x={x}&y={y}&z={z}', { |
|
attribution: `Map data ©${thn} <a href="https://www.google.com/intl/id_id/help/terms_maps/">Google</a>`, |
|
maxZoom: 30, |
|
minZoom: 1, |
|
tileSize: 256, |
|
zoomOffset: 0, |
|
noWrap: false, |
|
subdomains: '0123', |
|
accessToken: '' |
|
}) |
|
|
|
const Satellite = L.tileLayer('https://mt{s}.google.com/vt/lyrs=s&x={x}&y={y}&z={z}', { |
|
attribution: `Map data ©${thn} <a href="https://www.google.com/intl/id_id/help/terms_maps/">Google</a>`, |
|
maxZoom: 30, |
|
minZoom: 1, |
|
tileSize: 256, |
|
zoomOffset: 0, |
|
noWrap: false, |
|
subdomains: '0123', |
|
accessToken: '' |
|
}) |
|
const Hybrid = L.tileLayer('https://mt{s}.google.com/vt/lyrs=y&x={x}&y={y}&z={z}', { |
|
attribution: `Map data ©${thn} <a href="https://www.google.com/intl/id_id/help/terms_maps/">Google</a>`, |
|
maxZoom: 30, |
|
minZoom: 1, |
|
tileSize: 256, |
|
zoomOffset: 0, |
|
noWrap: false, |
|
subdomains: '0123', |
|
accessToken: '' |
|
}) |
|
const OSM1 = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { |
|
maxZoom: 30, |
|
minZoom: 1, |
|
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors' |
|
}) |
|
// export const Bing_ae = L.tileLayer.bing(bing_ae_opt) |
|
// export const Bing_r = L.tileLayer.bing(bing_r_opt) |
|
|
|
// export const baseLayers = { |
|
// GoogleRoad: Road, |
|
// GoogleSatellite: Satellite, |
|
// GoogleHybrid: Hybrid, |
|
// OpenStreetMap: OSM1, |
|
// BingAerial: Bing_ae, |
|
// BingRoad: Bing_r |
|
// } |
|
|
|
export const layersmaps = [ |
|
{ |
|
name: 'Open Street Map', |
|
url: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', |
|
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors', |
|
subdomains: ['a', 'b', 'c'], |
|
checked: true |
|
} |
|
// { |
|
// name: 'Google Road', |
|
// url: 'https://mt{s}.google.com/vt/lyrs=m&x={x}&y={y}&z={z}', |
|
// attribution: `Map data ©${thn} <a href="https://www.google.com/intl/id_id/help/terms_maps/">Google</a>`, |
|
// subdomains: ['0', '1', '2', '3'], |
|
// checked: false |
|
// }, |
|
// { |
|
// name: 'Google Satellite', |
|
// url: 'https://mt{s}.google.com/vt/lyrs=s&x={x}&y={y}&z={z}', |
|
// attribution: `Map data ©${thn} <a href="https://www.google.com/intl/id_id/help/terms_maps/">Google</a>`, |
|
// subdomains: ['0', '1', '2', '3'], |
|
// checked: false |
|
// }, |
|
// { |
|
// name: 'Google Hybrid', |
|
// url: 'https://mt{s}.google.com/vt/lyrs=y&x={x}&y={y}&z={z}', |
|
// attribution: `Map data ©${thn} <a href="https://www.google.com/intl/id_id/help/terms_maps/">Google</a>`, |
|
// subdomains: ['0', '1', '2', '3'], |
|
// checked: false |
|
// } |
|
] |
|
|
|
export const baseLayer = { |
|
osm: L.tileLayer('//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { |
|
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors', |
|
maxZoom: 23, |
|
minZoom: 1 |
|
}), |
|
Road: L.tileLayer('https://mt{s}.google.com/vt/lyrs=m&x={x}&y={y}&z={z}', { |
|
attribution: `Map data ©${thn} <a href="https://www.google.com/intl/id_id/help/terms_maps/">Google</a>`, |
|
maxZoom: 23, |
|
minZoom: 1, |
|
tileSize: 256, |
|
zoomOffset: 0, |
|
noWrap: false, |
|
subdomains: '3', |
|
accessToken: '' |
|
}), |
|
Satellite: L.tileLayer('https://mt{s}.google.com/vt/lyrs=s&x={x}&y={y}&z={z}', { |
|
attribution: `Map data ©${thn} <a href="https://www.google.com/intl/id_id/help/terms_maps/">Google</a>`, |
|
maxZoom: 23, |
|
minZoom: 1, |
|
tileSize: 256, |
|
zoomOffset: 0, |
|
noWrap: false, |
|
subdomains: '0123', |
|
accessToken: '' |
|
}), |
|
Hybrid: L.tileLayer('https://mt{s}.google.com/vt/lyrs=y&x={x}&y={y}&z={z}', { |
|
attribution: `Map data ©${thn} <a href="https://www.google.com/intl/id_id/help/terms_maps/">Google</a>`, |
|
maxZoom: 23, |
|
minZoom: 1, |
|
tileSize: 256, |
|
zoomOffset: 0, |
|
noWrap: false, |
|
subdomains: '0123', |
|
accessToken: '' |
|
}) |
|
}
|
|
|