Opmerking: na het publiceren is het wellicht nodig uw browsercache te legen om de veranderingen te zien.

  • Firefox / Safari: houd Shift ingedrukt terwijl u:je op Vernieuwen klikt of druk op Ctrl-F5 of Ctrl-R (⌘-Shift-R op een Mac)
  • Google Chrome: druk op Ctrl-Shift-R (⌘-Shift-R op een Mac)
  • Edge: houd Ctrl ingedrukt terwijl u:je op Vernieuwen klikt of druk op Ctrl-F5.
// Verwendung von OpenStreetMap in Wikipedia.
// (c) 2008 by Magnus Manske
// Released under GPL


function openStreetMapInit () {
  c = document.getElementById ( 'coordinates' ) ;
  if ( !c ) return ;

  a = c.getElementsByTagName ( 'a' ) ;
  geohack = 0 ;
  for ( i = 0 ; i < a.length ; i++ ) {
    h = a[i].href ;
    if ( !h.match(/geohack/) ) continue ;
    geohack = 1 ;
    break ;
  }
  if ( geohack == 0 ) return ;

  na = document.createElement ( 'a' ) ;
  na.href = '#' ;
  na.onclick = openStreetMapToggle ;
  na.appendChild ( document.createTextNode ( 'OSM' ) ) ;
//  c.appendChild ( document.createElement ( 'br' ) )
  c.appendChild ( document.createTextNode ( ' (' ) ) ;
  c.appendChild ( na ) ;
  c.appendChild ( document.createTextNode ( ')   ' ) ) ;
}

function openStreetMapToggle () {
  c = document.getElementById ( 'coordinates' ) ;
  if ( !c ) return ;
  cs = document.getElementById ( 'contentSub' ) ;
  osm = document.getElementById ( 'openstreetmap' ) ;

  if ( cs && osm ) {
    cs.removeChild ( osm ) ;
    return ;
  }

  var found_link = 0 ;
  a = c.getElementsByTagName ( 'a' ) ;
  for ( i = 0 ; i < a.length ; i++ ) {
    h = a[i].href ;
    if ( !h.match(/geohack/) ) continue ;
    found_link = 1 ;
    break ;
  }
  if ( found_link == 0 ) return ; // No geohack link found

  h = h.split('params=')[1] ;
  
  i = document.createElement ( 'iframe' ) ;
  url = 'http://tools.wikimedia.de/~magnus/ol/wp_poi.php?title=' + wgTitle ;
  url += '&language=' + wgUserLanguage ;
  url += '&params=' + h ;
  i.id = 'openstreetmap' ;
  i.style.width = '100%' ;
  i.style.height = '300px' ;
  i.style.clear = 'both' ;
  i.src = url ;
  cs.appendChild ( i ) ;
}


$(openStreetMapInit);