-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
731 lines (675 loc) · 38 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="canonical" href="https://amche.in" />
<title>amche.in - Interactive Map of Goa</title>
<!-- SEO and Social Media Meta Tags -->
<meta
name="description"
content="Explore Goa's interactive map featuring detailed cadastral boundaries, land use zones, construction sites, hill slopes, coastal zones (CZMP), and community-contributed locations. 3D terrain views, and regional development plans for comprehensive Goa mapping."
/>
<meta
name="keywords"
content="Goa maps, land use zones, cadastral maps, Goa construction sites, Goa coastal zones, CZMP, Survey of India, Goa terrain, Goa RDP, Goa hill slopes, interactive mapping, Goa community mapping, Goa land records"
/>
<!-- Open Graph Meta Tags for Social Media -->
<meta property="og:title" content="amche.in - Interactive Map of Goa" />
<meta
property="og:description"
content="Explore and contribute to the various layers of Goa's community maintained GIS map platform. Layers include cadastral boundaries, land use zones, construction sites, hill slopes, coastal regulation zones (CZMP), regional development plans along with user contributed map annotations."
<meta property="og:type" content="website" />
<meta property="og:url" content="https://amche.in" />
<meta property="og:image" content="https://amche.in/assets/og_image.jpg" />
<meta property="og:site_name" content="amche.in" />
<meta property="og:locale" content="en_IN" />
<!-- Twitter Card Meta Tags -->
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="amche.in - Interactive Map of Goa" />
<meta
name="twitter:description"
content="Explore and contribute to the various layers of Goa's community maintained GIS map platform. Layers include cadastral boundaries, land use zones, construction sites, hill slopes, coastal regulation zones (CZMP), regional development plans along with user contributed map annotations."
/>
<meta name="twitter:image" content="https://amche.in/assets/og_image.jpg" />
<!-- Tailwind CSS via CDN -->
<script src="https://cdn.tailwindcss.com"></script>
<!-- Mapbox GL JS -->
<link href='https://api.mapbox.com/mapbox-gl-js/v3.9.4/mapbox-gl.css' rel='stylesheet' />
<script src='https://api.mapbox.com/mapbox-gl-js/v3.9.4/mapbox-gl.js'></script>
<!-- Add Mapbox Geocoder CSS and JS -->
<script
src="https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-geocoder/v5.0.3/mapbox-gl-geocoder.min.js"></script>
<link rel="stylesheet"
href="https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-geocoder/v5.0.3/mapbox-gl-geocoder.css"
type="text/css">
<!-- Open Sans font -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@600&display=swap" rel="stylesheet">
<!-- Shoelace Components -->
<script type="module" src="https://cdn.jsdelivr.net/npm/@shoelace-style/[email protected]/cdn/shoelace.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@shoelace-style/[email protected]/cdn/themes/light.css" />
<link rel="stylesheet" href="styles.css">
<!-- Add jQuery -->
<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
<script type="module" src="map-layer-controls.js"></script>
<script src="geolocation-control.js"></script>
<script src="mapbox-gl-view-control.js"></script>
</head>
<body class="flex flex-col h-screen">
<!-- Header -->
<header class="bg-gray-900 text-white p-4 flex justify-between items-center">
<div class="flex items-center gap-4">
<h1 class="text-l"><a href="https://amche.in" class="text-white hover:underline">amche.in</a></h1>
<a href="/sound/index.html" onclick="navigateToSound(event)" class="text-white hover:text-gray-300"
title="Sound Map">
<svg class="w-4 h-4" fill="currentColor" viewBox="0 0 20 20">
<path
d="M9.383 3.076A1 1 0 0110 4v12a1 1 0 01-1.707.707L4.586 13H2a1 1 0 01-1-1V8a1 1 0 011-1h2.586l3.707-3.707a1 1 0 011.09-.217zM14.657 2.929a1 1 0 011.414 0A9.972 9.972 0 0119 10a9.972 9.972 0 01-2.929 7.071 1 1 0 01-1.414-1.414A7.971 7.971 0 0017 10c0-2.21-.894-4.208-2.343-5.657a1 1 0 010-1.414zm-2.829 2.828a1 1 0 011.415 0A5.983 5.983 0 0115 10a5.984 5.984 0 01-1.757 4.243 1 1 0 01-1.415-1.415A3.984 3.984 0 0013 10a3.983 3.983 0 00-1.172-2.828 1 1 0 010-1.415z" />
</svg>
</a>
</div>
<div class="flex gap-4">
<a href="https://github.com/publicmap/amche-goa" class="text-sm hover:underline">Source</a>
<a href="https://forms.gle/8J4HTJMUM1thWpGK9" target="_blank" class="text-sm hover:underline">Feedback</a>
</div>
</header>
<!-- Add the floating drawer toggle button -->
<sl-icon-button
name="list"
id="open-drawer"
class="fixed top-20 left-4 z-10 bg-white rounded-full shadow-lg hover:bg-gray-100"
style="font-size: 1.5rem; padding: 8px;"
></sl-icon-button>
<!-- Wrap main content in a container -->
<div class="flex flex-grow relative h-full">
<!-- Map Container -->
<main class="flex-grow relative h-full">
<div id="map" style="width: 100%; height: 100%;"></div>
<!-- Add drawer inside the map container -->
<sl-drawer id="map-controls-drawer" label="Map layers" placement="start" class="drawer-placement-start" contained>
<!-- Add this div for the header with flex layout -->
<div class="flex justify-between items-center mb-4">
<h2 class="text-md">Choose layers</h2>
<button id="share-link" class="flex items-center gap-2 px-3 py-1 text-sm bg-gray-100 hover:bg-gray-200 rounded-md transition-colors">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.368 2.684 3 3 0 00-5.368-2.684z"/>
</svg>
Share Link
</button>
</div>
<!-- Loading state using Shoelace components -->
<div id="layer-controls-loader" class="p-4">
<div class="flex flex-col gap-4" id="skeleton-container">
<!-- Skeletons will be added here dynamically -->
</div>
</div>
<div id="layer-controls-container" class="hidden"></div>
</sl-drawer>
<div id="edit-mode-control"
class="mapboxgl-ctrl mapboxgl-ctrl-group absolute bottom-10 right-0 z-10 bg-white rounded shadow-md mr-2">
<button id="edit-mode-toggle" class="px-2 py-1 text-sm flex items-center justify-center hover:bg-blue-500"
title="Toggle Edit Mode">
📌
</button>
</div>
</main>
</div>
<script>
//FIXME: move this function to a utils
function getQueryParameters() {
const queryString = window.location.search;
const urlParams = new URLSearchParams(queryString);
const params = {};
// Iterate through all entries in the URLSearchParams object
for (const [key, value] of urlParams.entries()) {
params[key] = value;
}
return params; // Return the object containing all query parameters
}
mapboxgl.accessToken = 'pk.eyJ1Ijoib3NtaW5kaWEiLCJhIjoiY202czRpbWdpMDNyZjJwczJqZXdkMGR1eSJ9.eQQf--msfqtZIamJN-KKVQ'; // Mapbox Token by OpenStreetMap India community via @planemad
// Initialize the map
// Mapbox Studio style https://www.mapbox.com/studio/styles/planemad/cm3gyibd3004x01qz08rohcsg/
// Camera position http://localhost:53662/#9.99/15.4121/73.9414/69.6/56
const map = new mapboxgl.Map({
container: 'map',
style: 'mapbox://styles/planemad/cm3gyibd3004x01qz08rohcsg',
center: [73.9414, 15.4121],
zoom: 9.99,
hash: true,
attributionControl: false
});
// Add attribution control
map.addControl(new mapboxgl.AttributionControl({
compact: true
}), 'bottom-right');
// Add the geocoder control
// https://docs.mapbox.com/mapbox-gl-js/example/mapbox-gl-geocoder/
// https://github.com/mapbox/mapbox-gl-geocoder/blob/main/API.md
const geocoder = new MapboxGeocoder({
accessToken: mapboxgl.accessToken,
mapboxgl: mapboxgl,
collapsed: true,
clearOnBlur: true,
marker: false,
countries: 'in',
worldview: 'in', // Restrict to India
types: 'place,locality,postcode',
placeholder: 'Search Places',// India bounding box
proximity: {
longitude: 73.87916,
latitude: 15.26032
}, // Bias results toward Goa
});
// Add 3D terrain
map.on('load', () => {
// Only add terrain if not already in style
const style = map.getStyle();
const hasTerrain = style.sources && style.sources['mapbox-dem'];
if (!hasTerrain) {
map.addSource('mapbox-dem', {
'type': 'raster-dem',
'url': 'mapbox://mapbox.mapbox-terrain-dem-v1',
'tileSize': 512,
'maxzoom': 14
});
map.setTerrain({
'source': 'mapbox-dem',
'exaggeration': 1.5
});
}
// Add geocoder control
map.addControl(geocoder, 'top-right');
// Initialize geolocation
new GeolocationManager(map);
// Add view control
map.addControl(new ViewControl(), 'top-right');
// Add OpenStreetMap source and layer
map.addSource('osm', {
'type': 'raster',
'tiles': [
'https://tile.openstreetmap.org/{z}/{x}/{y}.png'
],
'tileSize': 512,
'attribution': '© OpenStreetMap contributors'
});
map.addLayer({
'id': 'osm-tiles',
'type': 'raster',
'source': 'osm',
'layout': {
'visibility': 'none' // Hidden by default
},
'paint': {
'raster-opacity': 1
}
}); // Insert before building layer to show 3D buildings on top
// First fetch the GeoJSON data
fetch('https://gist.githubusercontent.com/planemad/ddca6df1de5ccf1b1663a5b7ab161b93/raw/46846b9da3964febabc044786a9b7a3b72840720/goa-construction-project-sites.geojson')
.then(response => response.json())
.then(e =>
{
// Put Layers in a variable, we may want to move this to a separate file or so.
let layersConfig = [
{
title: 'Community Pins',
description: 'Pin your notes on the map for the rest of the community to see',
headerImage: 'assets/map-layer-pins.png',
type: 'markers',
id: 'community-pins',
dataUrl: 'https://docs.google.com/spreadsheets/d/1Y0l4aSIdks8G3lmxSxSKxuzLoARL-FCiYbTL9a0b3O0/gviz/tq?tqx=out:json&tq&gid=0',
attribution: 'Source: Collected by amche.in | <a href="https://docs.google.com/spreadsheets/d/1Y0l4aSIdks8G3lmxSxSKxuzLoARL-FCiYbTL9a0b3O0/edit?resourcekey=&gid=485622101#gid=485622101">View Source Spreadsheet</a>',
style: {
'circle-color': '#FF4136',
'circle-radius': 8
},
inspect: {
title: 'Pin Details',
label: 'name',
fields: ['Location Name', 'Additional Notes (optional)', 'Timestamp_ago'],
fieldTitles: ['Name', 'Notes', 'Added'],
}
},
{
title: 'Community Maps',
description: 'Sketches, maps and plans by the people of Goa',
headerImage: 'assets/map-layer-community-maps.png',
type: 'tms',
id: 'community-maps',
url: 'https://mapwarper.net/mosaics/tile/2157/{z}/{x}/{y}.png',
attribution: '<a href="https://mapwarper.net/layers/2157">CC-BY-SA Mapwarper community maps of Goa</a>'
},
{
title: 'Plot Boundaries',
description: 'Cadastral Boundaries from the <a href="Directorate of Settlement & Land Records">Department of Land Records</a>. The map is provided for information purpose only. An official copy can be obtained from <a href="https://goaonline.gov.in" target="_blank" rel="noopener noreferrer">Goa Online</a>',
headerImage: 'assets/map-layer-survey.png',
type: 'vector',
id: 'goa-cadastral',
url: 'https://indianopenmaps.fly.dev/not-so-open/cadastrals/goa/bhunaksha/{z}/{x}/{y}.pbf',
sourceLayer: 'Goa_Bhunaksha_Cadastrals',
maxzoom: 16,
attribution: 'Source: <a href="https://bhunaksha.goa.gov.in/bhunaksha/">Goa Bhunaksha</a> - Collected by <a href="https://datameet.org">Datameet Community</a>',
style: {
'fill-color': [
'interpolate',
['linear'],
['zoom'],
15, 'rgba(0, 0, 0, 0.05)',
18, 'rgba(0, 0, 0, 0.1)'
],
'line-color': 'black',
'line-width': [
'interpolate',
['linear'],
['zoom'],
15, [
'case',
['boolean', ['feature-state', 'selected'], false],
2,
['boolean', ['feature-state', 'hover'], false],
1.5,
0
],
18, [
'case',
['boolean', ['feature-state', 'selected'], false],
6,
['boolean', ['feature-state', 'hover'], false],
5,
.5
]
]
},
initiallyChecked: true,
inspect: {
id: 'id',
title: 'Survey Number',
label: 'kide',
fields: ['VillageNam', 'TalName'],
fieldTitles: ['Village', 'Taluk'],
customHtml: 'Source: <a href="https://bhunaksha.goa.gov.in/bhunaksha/" target="_blank">Bhunaksha Goa</a> | <a href="https://goaonline.gov.in/Appln/Uil/DeptServices?__DocId=REV&__ServiceId=REV31" target="_blank">View RoR</a>'
}
},
{
id: 'village',
title: 'Village Boundaries',
headerImage: 'assets/map-layer-village.png',
description: 'Revenue village boundaries with <a href="https://lgdirectory.gov.in/" target="_blank">Local Government Directory</a> attributes.',
type: 'vector',
url: 'https://indianopenmaps.fly.dev/not-so-open/villages/lgd/{z}/{x}/{y}.pbf ',
sourceLayer: 'LGD_Villages',
maxzoom: 10,
attribution: 'Source: <a href="https://mapservice.gov.in/gismapservice/rest/services/BharatMapService/Village_Boundary/MapServer/0">NIC Bharatmaps GIS</a>, <a href="https://lgdirectory.gov.in/" target="_blank">Local Government Directory, Ministry of Panchayati Raj</a> - Collected by <a href="https://datameet.org">Datameet Community</a>',
style: {
'fill-color': [
'interpolate',
['linear'],
['zoom'],
8, 'rgba(0, 0, 0, 0)',
12, 'rgba(0, 0, 0, 0.1)'
],
'line-color': 'black',
'line-width': [
'interpolate',
['linear'],
['zoom'],
8, [
'case',
['boolean', ['feature-state', 'selected'], false],
1.5,
['boolean', ['feature-state', 'hover'], false],
1,
0
],
12, [
'case',
['boolean', ['feature-state', 'selected'], false],
3,
['boolean', ['feature-state', 'hover'], false],
2,
1
]
]
},
inspect: {
title: 'Village',
label: 'vilnam_soi',
id: 'OBJECTID',
fields: ['vil_lgd','gp_name','block_name','sdtname','dtname'],
fieldTitles: ['Village Code','Gram Panchayat','Block','Sub District','District']
}
},
{
id: 'municipal-wards',
title: 'Municipal Ward Boundaries',
headerImage: 'assets/map-layer-ulb-wards.png',
description: 'Ward boundaries for Panaji Municipal Corporation and Municipal Councils (partial coverage)',
type: 'vector',
url: 'https://indianopenmaps.fly.dev/not-so-open/urban/wards/sbm/{z}/{x}/{y}.pbf',
sourceLayer: 'SBM_Wards',
maxzoom: 12,
attribution: 'Source: <a href="https://sbm-g-esriindia1.hub.arcgis.com/">Swachh Bharat Mission GIS</a> - Collected by <a href="https://datameet.org">Datameet Community</a>',
style: {
'fill-color': [
'interpolate',
['linear'],
['zoom'],
16, 'rgba(0, 0, 0, 0.05)',
18, 'rgba(0, 0, 0, 0.1)'
],
'line-color': 'hsl(278, 82%, 57%)',
'line-width': [
'interpolate',
['linear'],
['zoom'],
12, [
'case',
['boolean', ['feature-state', 'selected'], false],
4,
['boolean', ['feature-state', 'hover'], false],
4,
1
],
18, [
'case',
['boolean', ['feature-state', 'selected'], false],
6,
['boolean', ['feature-state', 'hover'], false],
5,
3
]
]
},
inspect: {
title: 'Ward Number',
label: 'wardcode',
id: 'objectid',
fields: ['ulbname'],
fieldTitles: ['Urban Local Body']
}
},
{
id: 'goa-local-body',
title: 'Local Body Boundaries',
description: '<span style="display: inline-block; width: 30px; height: 12px; border: 3px dashed hsl(269, 100%, 45%);margin-right:5px"></span>Municipal Boundaries <br><span style="display: inline-block; width: 30px; height: 12px; border: 1px dashed hsl(269, 100%, 45%);margin-right:5px"></span>Panchayat Boundaries',
headerImage: 'assets/map-layer-local-boundaries.png',
type: 'layer-group',
groups: [
{
id: 'goa-local-body',
title: 'Bhuvan Panchayat',
attribution: 'https://grammanchitra.gov.in/gm4MVC',
}
],
initiallyChecked: true,
},
{
title: 'Reserve Forests',
description: 'Forest beat boundaries',
headerImage: 'assets/map-layer-forest.png',
type: 'vector',
id: 'india-forest',
url: 'https://indianopenmaps.fly.dev/not-so-open/forests/beats/fsi/{z}/{x}/{y}.pbf',
sourceLayer: 'FSI_Beats',
maxzoom: 11,
attribution: 'Source: <a href="https://bharatmaps.gov.in/BharatMaps/Home/Map">Bharatmaps/Forest Survey of India</a> - Collected by <a href="https://datameet.org">Datameet Community</a>',
style: {
'line-color': '#006400',
'line-width': [
'interpolate',
['linear'],
['zoom'],
14, [
'case',
['boolean', ['feature-state', 'selected'], false],
4,
['boolean', ['feature-state', 'hover'], false],
3,
1
],
18, [
'case',
['boolean', ['feature-state', 'selected'], false],
8,
['boolean', ['feature-state', 'hover'], false],
5,
.5
]
],
'fill-color': 'green'
},
inspect: {
id: 'OBJECTID_12',
title: 'Forest Range',
label: 'Beat_Name',
fields: ['Range'],
customHtml: 'Source: <a href="https://bhunaksha.goa.gov.in/bhunaksha/" target="_blank">Bharatmaps</a>'
}
},
{
id: 'slope-zones',
title: 'Slope Zoning',
description: 'Slope zone classification using terrain data',
type: 'layer-group',
headerImage: 'assets/map-layer-slope.png',
legendImage: 'assets/map-layer-slope-legend.png',
groups: [
{
id: 'nasadem-30-m',
title: 'NASA NASADEM 30m',
attribution: 'https://asterweb.jpl.nasa.gov/gdem.asp',
location: 'Goa'
},
{
id: 'cartodem-2-5-m',
title: 'ISRO CartoDEM 2.5m (Partial)',
attribution: 'https://bhuvan-app3.nrsc.gov.in/data/',
location: 'Guirim'
},
{
id: 'aster slope',
title: 'NASA Aster 30m (Goa Coast)',
attribution: 'https://gdemdl.aster.jspacesystems.or.jp/index_en.html',
location: 'Panaji'
}
]
},
{
title: 'Landuse Zoning Plans',
description: 'Regional Development Plan for Goa 2021 (RDP-2021) prepared by the <a href="https://tcp.goa.gov.in/">Goa Town & Country Planning Department</a> and <a href="https://tcp.goa.gov.in/regional-plan-for-goa-2021">notified</a> as per <a href="https://indiankanoon.org/doc/3192342/">The Goa, Daman and Diu Town and Country Planning Act 1974</a>',
headerImage: 'assets/map-layer-rdp.png',
legendImage: 'assets/map-layer-rdp-legend.jpg',
type: 'tms',
id: 'goa-rdp-map',
url: 'https://mapwarper.net/mosaics/tile/2054/{z}/{x}/{y}.png',
attribution: 'Regional Development Plan for Goa 2021, <a href="https://tcp.goa.gov.in/">Goa Town & Country Planning Department</a>. Georeferenced using <a href="https://mapwarper.net/layers/2054#Show_tab">Mapwarper</a>',
initiallyChecked: true
},
{
title: 'SOI Toposheets',
description: 'Survey of India',
headerImage: 'assets/map-layer-soi.png',
legendImage: 'assets/map-layer-soi-legend.png',
type: 'tms',
id: 'goa-soi-map',
url: 'https://indianopenmaps.fly.dev/soi/osm/{z}/{x}/{y}.webp',
attribution: 'Open Series Toposheets from Survey of India https://onlinemaps.surveyofindia.gov.in/FreeMapSpecification.aspx',
},
{
title: 'Goa CZMP',
description: 'Coastal Zone Management Plan 2019',
headerImage: 'assets/map-layer-czmp.png',
legendImage: 'assets/map-layer-czmp-legend.jpg',
type: 'tms',
id: 'goa-czmp-map',
url: 'https://indianopenmaps.fly.dev/not-so-open/coastal/goa/regulation/ncscm/{z}/{x}/{y}.webp',
attribution: 'Source: <a href="https://czmp.ncscm.res.in/">National Center For Sustainable Coastal Management</a> - Collected by <a href="https://datameet.org">Datameet Community</a>'
},
{
title: 'AMS Maps (1970s)',
description: '1:250000 maps from the U.S. Army Map Service created 1955-1970s',
headerImage: 'assets/map-layer-ams.png',
type: 'tms',
id: 'goa-ams-map',
url: 'https://mapwarper.net/maps/tile/89833/{z}/{x}/{y}.png',
attribution: 'Source: <a href="https://maps.lib.utexas.edu/maps/ams/india/">Perry-Castañeda Library Map Collection, The University of Texas at Austin</a> release in public domain'
},
{
id: 'osm',
title: 'OpenStreetMap',
description: 'OpenStreetMap Data',
headerImage: 'assets/map-layer-osm.png',
type: 'tms',
url: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
description: 'Map data contributed by the <a href="https://www.openstreetmap.in/">OpenStreetMap India Community.',
attribution: '© OpenStreetMap contributors'
},
{
title: 'Construction Sites',
description: 'Construction Project Sites',
headerImage: 'assets/map-layer-construction.png',
type: 'geojson',
id: 'construction-sites',
url: 'https://gist.githubusercontent.com/planemad/ddca6df1de5ccf1b1663a5b7ab161b93/raw/b15e2dce708ac4e1ef803cb7065527f5f9eb0f0d/goa-construction-project-sites.geojson',
attribution: 'Construction project sites in Goa',
style: {
fill: false,
line: {
color: '#ff0000',
width: 2
},
label: {
color: '#000000',
size: 12,
haloColor: '#ffffff',
haloWidth: 2
}
}
},
{
title: '3D Terrain',
description: 'Terrain Controls',
headerImage: 'assets/map-layer-terrain.png',
type: 'terrain',
initiallyChecked: true
}
];
// if the layers= query parameter is set, handle setting initiallyChecked on those layers
const queryParams = getQueryParameters();
if (queryParams.layers) {
const activeLayers = queryParams.layers.split(',').map(s => s.trim());
console.log('active layers', activeLayers);
layersConfig = layersConfig.map(layer => {
layer.initiallyChecked = activeLayers.includes(layer.id);
return layer;
});
}
console.log('layers config', layersConfig);
// Add layer control with multiple groups including GeoJSON
const layerControl = new MapLayerControl(layersConfig);
const container = document.getElementById('layer-controls-container');
// Hide loader and show controls
document.getElementById('layer-controls-loader').classList.add('hidden');
container.classList.remove('hidden');
layerControl.renderToContainer(container, map);
// Initialize controls for layers that should be initially checked
const initiallyCheckedLayers = layersConfig.filter(layer => layer.initiallyChecked);
console.log('Initially checked layers:', initiallyCheckedLayers.map(l => l.title));
initiallyCheckedLayers.forEach(layer => {
// Find the checkbox for this layer using jQuery
const $checkbox = $(`label:has(span:contains("${layer.title}")) input[type="checkbox"]`);
if ($checkbox.length && !$checkbox.prop('checked')) {
$checkbox.prop('checked', true);
$checkbox.trigger('change');
}
});
})
// Add navigation controls
map.addControl(new mapboxgl.NavigationControl({
showCompass: true,
showZoom: false
}));
// Only set camera position if there's no hash in URL
if (!window.location.hash) {
setTimeout(() => {
map.flyTo({
center: [73.8274, 15.4406],
zoom: 9,
pitch: 28,
bearing: 0,
duration: 4000,
essential: true,
curve: 1.42,
speed: 0.6
});
}, 2000);
}
});
</script>
<!-- Google tag (gtag.js) -->
<script>
if (window.location.hostname === 'amche.in') {
// Load Google Analytics
const gtagScript = document.createElement('script');
gtagScript.async = true;
gtagScript.src = 'https://www.googletagmanager.com/gtag/js?id=G-FBVGZ4HJV0';
document.head.appendChild(gtagScript);
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'G-FBVGZ4HJV0');
// Hotjar tracking code. See https://github.com/publicmap/amche-goa/issues/3
// (function (h, o, t, j, a, r) {
// h.hj = h.hj || function () { (h.hj.q = h.hj.q || []).push(arguments) };
// h._hjSettings = { hjid: 5234909, hjsv: 6 };
// a = o.getElementsByTagName('head')[0];
// r = o.createElement('script'); r.async = 1;
// r.src = t + h._hjSettings.hjid + j + h._hjSettings.hjsv;
// a.appendChild(r);
// })(window, document, 'https://static.hotjar.com/c/hotjar-', '.js?sv=');
}
</script>
<script>
function navigateToSound(event) {
event.preventDefault();
const currentHash = window.location.hash;
const baseUrl = window.location.origin;
window.location.href = `${baseUrl}/sound/${currentHash}`;
}
</script>
<!-- Modify the drawer initialization script -->
<script>
// Initialize drawer functionality after Shoelace components are ready
customElements.whenDefined('sl-drawer').then(() => {
const drawer = document.querySelector('.drawer-placement-start');
const openButton = document.querySelector('#open-drawer');
// Function to handle drawer state based on screen size
function handleDrawerState() {
if (window.innerWidth > 768) { // Desktop
drawer.show();
} else { // Mobile
drawer.hide();
}
}
// Initial state
handleDrawerState();
// Listen for window resize
window.addEventListener('resize', handleDrawerState);
// Toggle drawer when button is clicked
openButton.addEventListener('click', () => drawer.show());
});
</script>
<script>
// Add this after your existing scripts
const skeletonContainer = document.getElementById('skeleton-container');
const numberOfSkeletons = 15;
Array.from({ length: numberOfSkeletons }).forEach(() => {
const skeleton = document.createElement('sl-skeleton');
skeleton.className = 'skeleton-map-controls';
skeleton.setAttribute('effect', 'pulse');
skeletonContainer.appendChild(skeleton);
});
</script>
</body>
</html>