Clean up links, open links in new tab

This commit is contained in:
Markus Koch 2020-04-27 17:49:16 +02:00
parent 9bdb4095a7
commit 806348e676

View File

@ -5,6 +5,8 @@ var polyconf_show_street_names = 5; // Zoom level for when to start showing stre
var polyconf_show_cities = 5; /* City outlines will be filled on this level and further away */ var polyconf_show_cities = 5; /* City outlines will be filled on this level and further away */
var polyconf_show_districts = 4; /* Shown from polyconf_show_cities until this*/ var polyconf_show_districts = 4; /* Shown from polyconf_show_cities until this*/
var wikiurl_base = "https://wiki.linux-forks.de/mediawiki/index.php/"
var streetLabelsRenderer = new L.StreetLabels({ var streetLabelsRenderer = new L.StreetLabels({
collisionFlg: true, collisionFlg: true,
propertyName: 'name', propertyName: 'name',
@ -160,7 +162,7 @@ function load_tiles(name, id) {
minNativeZoom: 0, minNativeZoom: 0,
minZoom: 0, minZoom: 0,
noWrap: true, noWrap: true,
attribution: 'Map data &copy; <a href="https://wiki.linux-forks.de/mediawiki/index.php/Maps">Linux-Forks</a>', attribution: 'Map data &copy; <a href="' + wikiurl_base + 'Maps">Linux-Forks</a>',
id: id, id: id,
tileSize: 256, tileSize: 256,
zoomOffset: 0, zoomOffset: 0,
@ -204,7 +206,7 @@ function load_geojson(name, url, geotype, iconcolor, active=1, style={}) {
default: /* else it is a marker with the specified icon */ default: /* else it is a marker with the specified icon */
onEachFeature = function(feature, layer) { onEachFeature = function(feature, layer) {
label = String(feature.properties.name) label = String(feature.properties.name)
layer.bindPopup('<h1><a href="https://wiki.linux-forks.de/mediawiki/index.php/' + feature.properties.name + '">' + feature.properties.name + '</a> (' + feature.geometry.coordinates + ')</h1>' + '<p><img style="width:100%" src="' + feature.properties.image + '"></p>' + '<p>' + feature.properties.description + '</p>'); layer.bindPopup('<h1><a target="_blank" href="' + wikiurl_base + feature.properties.name + '">' + feature.properties.name + '</a> (' + feature.geometry.coordinates + ')</h1>' + '<p><img style="width:100%" src="' + feature.properties.image + '"></p>' + '<p>' + feature.properties.description + '</p>');
layer.bindTooltip(label, { layer.bindTooltip(label, {
permanent: true, permanent: true,
direction: "center", direction: "center",
@ -502,7 +504,7 @@ var baseballIcon = L.AwesomeMarkers.icon({
function onMapClick(e) { function onMapClick(e) {
var addinfo = ""; var addinfo = "";
if (current_location != "") if (current_location != "")
addinfo = " (part of " + current_location + ")"; addinfo = " (part of <a target=\"_blank\" href='" + wikiurl_base + current_location + "'>" + current_location + "</a>)";
if (current_feature) { if (current_feature) {
popup.setLatLng(e.latlng).setContent("This is " + current_feature.properties.name + addinfo).openOn(mymap); popup.setLatLng(e.latlng).setContent("This is " + current_feature.properties.name + addinfo).openOn(mymap);
} else { } else {