Create openstreetmap_geouri.user.js
This commit is contained in:
		
							parent
							
								
									924c6cf571
								
							
						
					
					
						commit
						17ce1ca924
					
				
					 1 changed files with 17 additions and 0 deletions
				
			
		
							
								
								
									
										17
									
								
								openstreetmap_geouri.user.js
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								openstreetmap_geouri.user.js
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,17 @@
 | 
			
		|||
// ==UserScript==
 | 
			
		||||
// @name        OpenStreetmap
 | 
			
		||||
// @namespace   https://www.schtobia.de/
 | 
			
		||||
// @include     https://www.openstreetmap.org/*
 | 
			
		||||
// @description OpenStreetmap GeoURI Handler
 | 
			
		||||
// @version     0.1.7
 | 
			
		||||
// @grant       GM_getValue
 | 
			
		||||
// @grant       GM_listValues
 | 
			
		||||
// @downloadURL https://github.com/schtobia/github-solarized/raw/master/openstreetmap_geouri.user.js
 | 
			
		||||
// @updateURL   https://github.com/schtobia/github-solarized/raw/master/openstreetmap_geouri.user.js
 | 
			
		||||
// ==/UserScript==
 | 
			
		||||
 | 
			
		||||
window.navigator.registerProtocolHandler("geo", "https://www.openstreetmap.org/geouri/%s", GM_info.script.name);
 | 
			
		||||
 | 
			
		||||
var regex = /geouri\/geo(%3A|:)([0-9\.-]+)(%2C|,)([0-9\.-]+)/;
 | 
			
		||||
if (location.href.match(regex))
 | 
			
		||||
    location.href = location.href.replace(regex, "?mlat=$2&mlon=$4&zoom=12");
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue