X-Git-Url: https://git.toastfreeware.priv.at/philipp/winterrodeln/mediawiki_extensions/wrmap.git/blobdiff_plain/58b5dd2003b0e53490bd823c8602360042aba5c1..1234fddc62ff7e34d1b5b7d2f5f613fc18e45ef1:/wrmap.body.php diff --git a/wrmap.body.php b/wrmap.body.php index 0d6020b..7fc7265 100644 --- a/wrmap.body.php +++ b/wrmap.body.php @@ -287,7 +287,7 @@ class WrBaseMap { $image_url = WrBaseMap::wikipage_to_image($title, 150); if (!is_null($image_url)) $properties['thumb_url'] = $image_url; $json_feature = array( - 'type' => 'feature', + 'type' => 'Feature', 'geometry' => array( 'type' => 'Point', 'coordinates' => array($lon, $lat) @@ -343,7 +343,7 @@ class WrBaseMap { $coordinates = WrBaseMap::geo_to_coordinates($feature); if (count($coordinates) != 1) throw new Exception(wfMessage('wrmap-error-coordinate-count', $feature->getName())->text()); $json_feature = array( - 'type' => 'feature', + 'type' => 'Feature', 'geometry' => array( 'type' => 'Point', 'coordinates' => reset($coordinates) @@ -371,7 +371,7 @@ class WrBaseMap { $properties['strokeWidth'] = $stroke_width; } $json_feature = array( - 'type' => 'feature', + 'type' => 'Feature', 'geometry' => array( 'type' => 'LineString', 'coordinates' => WrBaseMap::geo_to_coordinates($feature) @@ -399,7 +399,8 @@ class WrBaseMap { assert(in_array($tagname, array('wrmap', 'wrgmap'))); $parserOutput = $parser->getOutput(); - // $parserOutput->addHeadItem('', 'googlemaps'); + $parserOutput->addHeadItem('', 'openlayers_js'); + $parserOutput->addHeadItem('', 'openlayers_css'); $parserOutput->addModules('ext.wrmap'); // append all sledruns as icon @@ -437,12 +438,16 @@ 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-ext-path' => "$wgExtensionAssetsPath/wrmap")); + $div_map = $doc->appendElement('div', array('class' => 'wrmap', 'style' => 'border-style:none;', 'data-ext-path' => "$wgExtensionAssetsPath/wrmap")); // progress message - $div->appendElement('div', array())->appendText(wfMessage('wrmap-loading')->text()); + $div_map->appendElement('div', array())->appendText(wfMessage('wrmap-loading')->text()); // data - $div->appendElement('div', array('style' => 'height: 0px; display:none;'))->appendText($json_string); - return array($doc->saveHTML($div), 'markerType' => 'nowiki'); + $div_map->appendElement('div', array('style' => 'height: 0px; display:none;'))->appendText($json_string); + // popup + $div_popup = $doc->appendElement('div', array('id' => 'popup', 'class' => 'ol-popup')); + $div_popup->appendElement('a', array('id' => 'popup-closer', 'href' => '#', 'class' => 'ol-popup-closer')); + $div_popup->appendElement('div', array('id' => 'popup-content')); + return array($doc->saveHTML($div_map) . $doc->saveHTML($div_popup), 'markerType' => 'nowiki'); }