The OpenLayers image path is set now.
authorphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Wed, 12 Dec 2012 14:18:41 +0000 (14:18 +0000)
committerphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Wed, 12 Dec 2012 14:18:41 +0000 (14:18 +0000)
git-svn-id: http://www.winterrodeln.org/svn/servermediawiki/trunk/extensions/wrmap@1232 7aebc617-e5e2-0310-91dc-80fb5f6d2477

wrmap.body.php
wrmap.js

index 546a778507e4d142d5b894526eecd359e4831155..e0f7d2ca380319678b93ff77873f3fe69afd9966 100644 (file)
@@ -27,7 +27,8 @@ class WrMap {
                $parserOutput->addModules('ext.wrmap');
                
                // Create <div/> element where the map is placed in
-               $output = "<div class=\"wrmap\" style=\"width: 100%; height: 450px; border-style:none;\" data-center-lon=\"$longitude_s\" data-center-lat=\"$latitude_s\" data-zoom=\"$zoom\">\n";
+               global $wgExtensionAssetsPath;
+               $output = "<div class=\"wrmap\" style=\"width: 100%; height: 450px; border-style:none;\" data-center-lon=\"$longitude_s\" data-center-lat=\"$latitude_s\" data-zoom=\"$zoom\" data-img-path=\"$wgExtensionAssetsPath/wrmap/openlayers/img/\">\n";
                foreach ($sledruns as $sledrun) {
                        $lat = $sledrun['position_latitude'];
                        $lon = $sledrun['position_longitude'];
index 779145373fcc8cc2354f6625731f042a93d7a029..f2e7fa171a5de3d7c29896a0ae2b1e467603df2b 100644 (file)
--- a/wrmap.js
+++ b/wrmap.js
@@ -1,5 +1,6 @@
 function init_wrmap(i, jq_map) {
        jq_map = $(jq_map);
+       OpenLayers.ImgPath = jq_map.attr('data-img-path'); // e.g. "/mediawiki/extensions/wrmap/openlayers/img/"
        var jq_sledruns = jq_map.children();
        jq_sledruns.detach();