Skip to content

Commit 5e137ec

Browse files
Mark JessopMark Jessop
authored andcommitted
Add HighSight satellite imagery
1 parent 24c5e13 commit 5e137ec

File tree

1 file changed

+32
-19
lines changed

1 file changed

+32
-19
lines changed

js/sondehub.js

Lines changed: 32 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -619,13 +619,23 @@ var getlost = L.tileLayer('https://live.getlost.com.au/{z}/{x}/{y}.jpg', {
619619
});
620620
getlost.id = "GetLost";
621621

622+
var highSight = L.tileLayer('https://api.highsight.dev/v1/tiles/{z}/{x}/{y}?key=ARX3jYxzWotJVz7ZgdDiMQI18tZJ5WCk', {
623+
attribution: '&copy; <a href="https://highsight.dev/">HighSight</a>',
624+
maxZoom: 9,
625+
minZoom: 3
626+
});
627+
628+
highSight.id = "HighSight";
629+
630+
622631
var baseMaps = {
623632
"Mapnik": osm,
624633
"DarkMatter": dark_matter,
625634
"WorldImagery": worldimagery,
626635
"Terrain": stamen_terrain,
627636
"Voyager": cartodb_voyager,
628637
"OpenTopoMap": opentopomap,
638+
"HighSight": highSight
629639
}
630640

631641
var selectedLayer = "Mapnik";
@@ -639,6 +649,7 @@ var tile_loads = {
639649
"Terrain": 0,
640650
"Voyager": 0,
641651
"OpenTopoMap": 0,
652+
"HighSight": 0
642653
}
643654

644655
// Add handlers to eadh tileload event to simply increment a counter.
@@ -649,34 +660,36 @@ worldimagery.on('tileload', function() { tile_loads["WorldImagery"]++ });
649660
stamen_terrain.on('tileload', function() { tile_loads["Terrain"]++ });
650661
cartodb_voyager.on('tileload', function() { tile_loads["Voyager"]++ });
651662
opentopomap.on('tileload', function() { tile_loads["OpenTopoMap"]++ });
663+
highSight.on('tileload', function() { tile_loads["HighSight"]++ });
652664

653665

654666
var last_sent_tile_loads = {}
655667

656-
setInterval(function(){
668+
// Disabled 2025-02-04
669+
// setInterval(function(){
657670

658-
temp_tile_loads = Object.assign({},tile_loads);
671+
// temp_tile_loads = Object.assign({},tile_loads);
659672

660-
// Check if the tile load count has changed.
661-
// Using JSON stringify is a bit of a hack, but appropriate for this kind of job.
662-
if(JSON.stringify(last_sent_tile_loads) == JSON.stringify(temp_tile_loads)){
663-
// Tile loads havent changed, do nothing,
664-
} else {
665-
// Tile loads have changed. Update the store, and send the data.
666-
last_sent_tile_loads = Object.assign({},tile_loads);
673+
// // Check if the tile load count has changed.
674+
// // Using JSON stringify is a bit of a hack, but appropriate for this kind of job.
675+
// if(JSON.stringify(last_sent_tile_loads) == JSON.stringify(temp_tile_loads)){
676+
// // Tile loads havent changed, do nothing,
677+
// } else {
678+
// // Tile loads have changed. Update the store, and send the data.
679+
// last_sent_tile_loads = Object.assign({},tile_loads);
667680

668-
// Send!
681+
// // Send!
669682

670-
$.ajax({
671-
type: "PUT",
672-
url: "https://api.v2.sondehub.org/tiles/count",
673-
contentType: "application/json; charset=utf-8",
674-
dataType: "json",
675-
data: JSON.stringify({'client': clientID, 'tile_loads': last_sent_tile_loads}),
676-
});
677-
}
683+
// $.ajax({
684+
// type: "PUT",
685+
// url: "https://api.v2.sondehub.org/tiles/count",
686+
// contentType: "application/json; charset=utf-8",
687+
// dataType: "json",
688+
// data: JSON.stringify({'client': clientID, 'tile_loads': last_sent_tile_loads}),
689+
// });
690+
// }
678691

679-
}, 60000)
692+
// }, 60000)
680693

681694

682695

0 commit comments

Comments
 (0)