From 5fece15c0ae1d861841678a4b8973649dfc8c7a7 Mon Sep 17 00:00:00 2001 From: anomen Date: Wed, 13 Jun 2012 20:18:51 +0200 Subject: [PATCH] www-client/opera/userjs - geocaching.com - add google maps --- www-client/opera/userjs/gc_maps_gmaps.js | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 www-client/opera/userjs/gc_maps_gmaps.js diff --git a/www-client/opera/userjs/gc_maps_gmaps.js b/www-client/opera/userjs/gc_maps_gmaps.js new file mode 100644 index 0000000..f4f44f8 --- /dev/null +++ b/www-client/opera/userjs/gc_maps_gmaps.js @@ -0,0 +1,8 @@ +// ==UserScript== +// @name FF+Chrome Google maps + Amapy.cz možnost vypnutí v1.6 +// @namespace none +// @description Přidá google mapu, google satelitní mapu, google teréní a turistickou mapu z Amapy.cz. Navíc možnost mapsy disablovat. Nyní i pro Chrome a Operu +// @include *geocaching.com/map* +// ==/UserScript== + +if((navigator.userAgent.indexOf("Chrome") != -1) || (navigator.userAgent.indexOf("Opera") != -1)) {var script = document.createElement('script');script.setAttribute("type", "application/javascript");script.textContent = 'Groundspeak.Map.MapLayers.unshift({tileUrl:"http://mt.google.com/vt?&x={x}&y={y}&z={z}",name:"googlemaps",alt:"Google maps",attribution:"Google maps",subdomains:"1234",tileSize:256,minZoom:0,maxZoom:22},{tileUrl:"http://mt.google.com/vt?lyrs=y&x={x}&y={y}&z={z}&scaleControl=true",name:"googlemapshyb",alt:"Google hybrid",attribution:"Google hybrid",subdomains:"1234",tileSize:256,minZoom:0,maxZoom:22},{tileUrl:"http://mt.google.com/vt?lyrs=s&x={x}&y={y}&z={z}&scaleControl=true",name:"googlemapssat",alt:"Google satelit",attribution:"Google satelit",subdomains:"1234",tileSize:256,minZoom:0,maxZoom:22},{tileUrl:"http://mt.google.com/vt?lyrs=p&x={x}&y={y}&z={z}",name:"googlemapssat",alt:"Google terrain",attribution:"Google terrain",subdomains:"1234",tileSize:256,minZoom:0,maxZoom:22},{tileUrl:"http://maps11.i0.cz/mps/ch_turis/{z}/{x}/{x}_{y}.gif",name:"amapy",alt:"Amapy turistická",attribution:"Amapy turistická",tileSize:256,minZoom:13,maxZoom:16});for (var a = {}, b = [], c = 0, d = Groundspeak.Map.MapLayers.length; c < d; c++) {var e = Groundspeak.Map.MapLayers[c],g = new L.TileLayer(e.tileUrl, e);b.push(g);a[e.alt] = g}a = new L.Control.Layers(a);MapSettings.Map.removeLayer(MapSettings.Map._layers[1]);$("a[title=Layers]").parent().remove();MapSettings.Map.addControl(a);$(a._form.getElementsByTagName("input")[0]).click();';document.body.appendChild(script);}else{var unsafeWindow = this['unsafeWindow'] || window;GM_registerMenuCommand('Vypnutí map',function(){GM_setValue('cisla',prompt('Vlož čísla map, které chceš skrýt, oddělené čárkou.', GM_getValue('cisla','')));window.location.reload();});var zob=GM_getValue('zobraz', '');var h1;var txt;if(!zob){h1="Skrýt čísla";txt="Skrýt čísla u map?";}else{h1="Zobrazit čísla";txt="Zobrazit čísla u map?";}GM_registerMenuCommand(h1,function(){if(confirm(txt)){if(zob){zob=false;}else{zob=true;}}GM_setValue('zobraz',zob);window.location.reload();});layers = unsafeWindow.Groundspeak.Map.MapLayers;layers.unshift({tileUrl:"http://mt.google.com/vt?&x={x}&y={y}&z={z}",name:"googlemaps",alt:"Google maps",attribution:"Google maps",subdomains:"1234",tileSize:256,minZoom:0,maxZoom:22},{tileUrl:"http://mt.google.com/vt?lyrs=y&x={x}&y={y}&z={z}&scaleControl=true",name:"googlemapshyb",alt:"Google hybrid",attribution:"Google hybrid",subdomains:"1234",tileSize:256,minZoom:0,maxZoom:22},{tileUrl:"http://mt.google.com/vt?lyrs=s&x={x}&y={y}&z={z}&scaleControl=true",name:"googlemapssat",alt:"Google satelit",attribution:"Google satelit",subdomains:"1234",tileSize:256,minZoom:0,maxZoom:22},{tileUrl:"http://mt.google.com/vt?lyrs=p&x={x}&y={y}&z={z}",name:"googlemapssat",alt:"Google terrain",attribution:"Google terrain",subdomains:"1234",tileSize:256,minZoom:0,maxZoom:22},{tileUrl:"http://maps11.i0.cz/mps/ch_turis/{z}/{x}/{x}_{y}.gif",name:"amapy",alt:"Amapy turistická",attribution:"Amapy turistická",tileSize:256,minZoom:13,maxZoom:16});if(!GM_getValue('zobraz', 'false')){for(i=0;i