@@ -641,61 +641,6 @@ var baseMaps = {
641641
642642var selectedLayer = "Mapnik" ;
643643
644- // Tile load analytics - 2023-01-09
645- // This code allows us to get some understanding of total tile loads across all users.
646- var tile_loads = {
647- "Mapnik" : 0 ,
648- "DarkMatter" : 0 ,
649- "WorldImagery" : 0 ,
650- "Terrain" : 0 ,
651- "Voyager" : 0 ,
652- "OpenTopoMap" : 0 ,
653- "HighSight" : 0
654- }
655-
656- // Add handlers to eadh tileload event to simply increment a counter.
657- // We don't need any more data than this.
658- osm . on ( 'tileload' , function ( ) { tile_loads [ "Mapnik" ] ++ } ) ;
659- dark_matter . on ( 'tileload' , function ( ) { tile_loads [ "DarkMatter" ] ++ } ) ;
660- worldimagery . on ( 'tileload' , function ( ) { tile_loads [ "WorldImagery" ] ++ } ) ;
661- stamen_terrain . on ( 'tileload' , function ( ) { tile_loads [ "Terrain" ] ++ } ) ;
662- cartodb_voyager . on ( 'tileload' , function ( ) { tile_loads [ "Voyager" ] ++ } ) ;
663- opentopomap . on ( 'tileload' , function ( ) { tile_loads [ "OpenTopoMap" ] ++ } ) ;
664- highSight . on ( 'tileload' , function ( ) { tile_loads [ "HighSight" ] ++ } ) ;
665-
666-
667- var last_sent_tile_loads = { }
668-
669- // Disabled 2025-02-04
670- // setInterval(function(){
671-
672- // temp_tile_loads = Object.assign({},tile_loads);
673-
674- // // Check if the tile load count has changed.
675- // // Using JSON stringify is a bit of a hack, but appropriate for this kind of job.
676- // if(JSON.stringify(last_sent_tile_loads) == JSON.stringify(temp_tile_loads)){
677- // // Tile loads havent changed, do nothing,
678- // } else {
679- // // Tile loads have changed. Update the store, and send the data.
680- // last_sent_tile_loads = Object.assign({},tile_loads);
681-
682- // // Send!
683-
684- // $.ajax({
685- // type: "PUT",
686- // url: "https://api.v2.sondehub.org/tiles/count",
687- // contentType: "application/json; charset=utf-8",
688- // dataType: "json",
689- // data: JSON.stringify({'client': clientID, 'tile_loads': last_sent_tile_loads}),
690- // });
691- // }
692-
693- // }, 60000)
694-
695-
696-
697-
698-
699644
700645// set map if in memory
701646var maplayer = offline . get ( "map" )
0 commit comments