From 51e39eb35caf38e7db46a76760b63cfecd546846 Mon Sep 17 00:00:00 2001 From: philipp Date: Thu, 14 Nov 2013 21:27:17 +0000 Subject: [PATCH] Now using internal map marker images and no more files from /vorlage. git-svn-id: http://www.winterrodeln.org/svn/servermediawiki/mediawiki_extensions/wrmap/trunk@1806 7aebc617-e5e2-0310-91dc-80fb5f6d2477 --- wrmap.body.php | 2 +- wrmap.js | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/wrmap.body.php b/wrmap.body.php index 2ce595d..c04aaed 100644 --- a/wrmap.body.php +++ b/wrmap.body.php @@ -279,7 +279,7 @@ class WrBaseMap { // Create
element where the map is placed in global $wgExtensionAssetsPath; $doc = new WrMapDOMDocument(); - $div = $doc->appendElement('div', array('class' => 'wrmap', 'style' => 'border-style:none;', 'data-img-path' => "$wgExtensionAssetsPath/wrmap/openlayers/img/")); + $div = $doc->appendElement('div', array('class' => 'wrmap', 'style' => 'border-style:none;', 'data-ext-path' => "$wgExtensionAssetsPath/wrmap")); // progress message $div->appendElement('div', array())->appendText('Die Landkarte wird geladen...'); // data diff --git a/wrmap.js b/wrmap.js index ae02ab2..d62b37b 100644 --- a/wrmap.js +++ b/wrmap.js @@ -25,7 +25,9 @@ function init_wrmap(i, jq_map) { // extract geojson from map element and clear map element's content jq_map = $(jq_map); - OpenLayers.ImgPath = jq_map.attr('data-img-path'); // e.g. "/mediawiki/extensions/wrmap/openlayers/img/" + var ext_path = jq_map.attr('data-ext-path'); // e.g. '/mediawiki/extensions/wrmap' + var img_path = ext_path + '/img'; + OpenLayers.ImgPath = ext_path + '/openlayers/img/'; // e.g. '/mediawiki/extensions/wrmap/openlayers/img/' var json_string = jq_map.children().last().text(); jq_map.empty(); // once parsed, remove geojson string from the map element. var format_json = new OpenLayers.Format.JSON(); @@ -124,12 +126,12 @@ function init_wrmap(i, jq_map) { new OpenLayers.Rule({ filter: filter_point_sledrun, symbolizer: { - externalGraphic: '/vorlagen/bahnzustand${getCondition}nn.png', + externalGraphic: img_path + '/marker_c_sledrun_${getCondition}nn.png', graphicWidth: 17, graphicHeight: 17, graphicXOffset: -8, graphicYOffset: -8, - backgroundGraphic: "/vorlagen/gmap_rodelbahn_c_s.png", + backgroundGraphic: img_path + '/marker_c_shadow.png', backgroundWidth: 23, backgroundHeight: 23, backgroundXOffset: -8, @@ -139,7 +141,7 @@ function init_wrmap(i, jq_map) { new OpenLayers.Rule({ elseFilter: true, symbolizer: { - externalGraphic: '/vorlagen/gmap_${getSymbol}.png', + externalGraphic: img_path + '/marker_c_shadow.png', graphicWidth: 20, graphicHeight: 34, graphicXOffset: -10, @@ -172,7 +174,7 @@ function init_wrmap(i, jq_map) { symbolizer: { label: "${name}", labelYOffset: 14, - externalGraphic: '/vorlagen/bahnzustand${getCondition}nh.png' + externalGraphic: img_path + '/marker_c_sledrun_${getCondition}nh.png' } }), new OpenLayers.Rule({ @@ -193,7 +195,7 @@ function init_wrmap(i, jq_map) { new OpenLayers.Rule({ filter: filter_point_sledrun, symbolizer: { - externalGraphic: '/vorlagen/bahnzustand${getCondition}nh.png', + externalGraphic: img_path + '/marker_c_sledrun_${getCondition}nh.png', backgroundGraphic: false, graphicXOffset: -6, graphicYOffset: -6 -- 2.39.5