Now using internal map marker images and no more files from /vorlage.
authorphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Thu, 14 Nov 2013 21:27:17 +0000 (21:27 +0000)
committerphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Thu, 14 Nov 2013 21:27:17 +0000 (21:27 +0000)
git-svn-id: http://www.winterrodeln.org/svn/servermediawiki/mediawiki_extensions/wrmap/trunk@1806 7aebc617-e5e2-0310-91dc-80fb5f6d2477

wrmap.body.php
wrmap.js

index 2ce595d0300b94328e27c2e5ca28af7c17d8179f..c04aaed95329754be7acc68d7c2360b4e0dda3de 100644 (file)
@@ -279,7 +279,7 @@ class WrBaseMap {
                // Create <div/> element where the map is placed in
                global $wgExtensionAssetsPath;
                $doc = new WrMapDOMDocument();
                // Create <div/> 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
                // progress message
                $div->appendElement('div', array())->appendText('Die Landkarte wird geladen...');
                // data
index ae02ab2b1385cd91819cad8b81a0e65aa2301bb0..d62b37b48f72c3c865b6ae9393de3dd97862ee66 100644 (file)
--- 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);
 
        // 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();
        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: {
                                                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,
                                                                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,
                                                                backgroundWidth: 23,
                                                                backgroundHeight: 23,
                                                                backgroundXOffset: -8,
@@ -139,7 +141,7 @@ function init_wrmap(i, jq_map) {
                                                new OpenLayers.Rule({
                                                        elseFilter: true,
                                                        symbolizer: {
                                                new OpenLayers.Rule({
                                                        elseFilter: true,
                                                        symbolizer: {
-                                                               externalGraphic: '/vorlagen/gmap_${getSymbol}.png',
+                                                               externalGraphic: img_path + '/marker_c_shadow.png',
                                                                graphicWidth: 20,
                                                                graphicHeight: 34,
                                                                graphicXOffset: -10,
                                                                graphicWidth: 20,
                                                                graphicHeight: 34,
                                                                graphicXOffset: -10,
@@ -172,7 +174,7 @@ function init_wrmap(i, jq_map) {
                                                        symbolizer: {
                                                                label: "${name}",
                                                                labelYOffset: 14,
                                                        symbolizer: {
                                                                label: "${name}",
                                                                labelYOffset: 14,
-                                                               externalGraphic: '/vorlagen/bahnzustand${getCondition}nh.png'
+                                                               externalGraphic: img_path + '/marker_c_sledrun_${getCondition}nh.png'
                                                        }
                                                }),
                                                new OpenLayers.Rule({
                                                        }
                                                }),
                                                new OpenLayers.Rule({
@@ -193,7 +195,7 @@ function init_wrmap(i, jq_map) {
                                                new OpenLayers.Rule({
                                                        filter: filter_point_sledrun,
                                                        symbolizer: {
                                                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
                                                                backgroundGraphic: false,
                                                                graphicXOffset: -6,
                                                                graphicYOffset: -6