How would I go about adding the API key for OpenWeatherMap overlays?
Extension talk:Maps
Appearance
Apologies, I didn't see the notice about Github on the sidebar. I've asked this question here.
How do I Disable or Remove the Category Footer?
"Category: Pages with a map rendered by the Maps extension"
I haven't found out how to remove the footer but I have found out how to rename it.
Locate the file /extensions/Maps/Maps.i18n.php
Line 21... 'maps-tracking-category' => 'Pages with a map rendered by the Maps',
Change to... 'maps-tracking-category' => 'Maps',
Languages Note: this setting is respecified in other languages in the same file
This will update the link in newly saved articles. If you have any existing articles pointing to the old category name click on the link that it provides and it will provide a list of articles that need to be updated. Edit and save is all that is required.
Suggestion: please update the documentation to explain where these global values are set.
I did the same which worked for me. When changing to 'maps-tracking-category' => the link disappears. No problem for me on a local wiki (with a backup). But I am not sure if this is doing something nasty with the wiki on the long run. So be careful.
This is a hidden category. Why do you want to remove it?
What do you mean by "hidden"? It's perfectly visible along with any other categories one may be using, so I guess that's what this post is about.
Indeed, if this is hidden I don't want to know what it looks like if it is not hidden :-).
But it is easy to make it hidden by adding '__HIDDENCAT__' to the category page.
Thanks AdSvS, your solution works. Didn't tinker with the php file.
dose not work for me
Is it possible to display more than one GeoJSON page/file on a map?
Unfortunately the following variant does not work:
{{#display_map: height=600px | geojson=Albania; Greece | scrollzoom=on }}
Thanks a lot!
I am using MediaWiki 1.39.3, PHP 8.1.18, MariaDB 10.3.38, and Maps 10.0.0. When I view Special:Version, I can see Maps 10.0.0. Everything else in MediaWiki is working, but today I just tried to view a map for the first time and every time I try to enter something like any of these, the page gives Error 500:
{{#display_map:center=Brandenburg Gate Berlin}}
{{#google_maps:center=Brandenburg Gate Berlin}}
In my LocalSettings.php, I have the following:
wfLoadExtension( 'Maps' );
$egMapsDefaultService = 'googlemaps3';
$egMapsGMaps3ApiKey = '<my_key>';
$egMapsDefaultGeoService = 'google';
Any help would be greatly appreciated.
I'm posting an update to my own question. "tail /var/log/httpd/access_log" shows:
AH01071: Got error 'Primary script unknown'
I have the same problem.
WM 1.39.3, PHP 8.0.30 (fpm-fcgi), MariaDB 10.5.23, maps 10.1.1
when interting {{#display_map:center=Brandenburg Gate Berlin}} at main page for example I get the Error 500 when submitting.
Have you figured out the problem yet?
Hello! I am trying to get an image overlay to align with my geoJSON in leaflet, as in the New York subway example in the documentation. However, the image is always centred on (0,0), rather than where my geoJSON data is.
{{#display_map:|image layers=myimage.png|geojson=mygeojson|height=600|width=900|zoom=3.75}}
Edit: The image actually isn't centred on (0,0). I'm not sure how it is aligned, but it's not with the bounds of the geojson
Ah! It's always aligning the bottom-left corner of the image to (0,0).
I've tried to work around this by putting the bottom left corner of my geoJSON at (0,0), however the problem remains that the image layer is constrained to a set width, which cannot be modified inside the display_map code.
What you are trying to do is indeed not possible without changes to Maps. Pull Requests and/or funding welcome.
When using the GeoJson format, is it possible to have, e.g. in de 'description' property, a link to a Wiki page? It's not in the list with limitations (https://maps.extension.wiki/wiki/Leaflet_GeoJSON#Limitations).
Good question. Came here for the same feature.
So I added the feature by editing /Maps/resources/leaflet/FeatureBuilder.js
and modifying function createMarker(properties, options) with something like
if( properties.hasOwnProperty('text') && properties.text.length > 0 ) {
marker.bindPopup( '<a href="/'+ properties.title+'>'+properties.text+'</a>' );
}
Hello, we have MW 1.39.4 LTS version in our RHEL 7 server. We have installed number of extensions and most of them are working properly. But Maps doesn't. Tried to add this one to show map, {{#display_map:center=Berlin|width=400|height=250}}
It throws below error:
/wiki/index.php?title=Testmap&action=submit Error: Call to undefined method ParamProcessor\Processor::setParameterDefinitions()
Backtrace:
from /data/www/html/wiki/extensions/Maps/src/Map/DisplayMap/DisplayMapFunction.php(58)
#0 /data/www/html/wiki/extensions/Maps/src/ParserHookSetup.php(80): Maps\Map\DisplayMap\DisplayMapFunction->getMapHtmlForKeyValueStrings()
#1 /data/www/html/wiki/extensions/Maps/src/ParserHookSetup.php(58): Maps\ParserHookSetup->handleFunctionHook()
#2 /data/www/html/wiki/includes/parser/Parser.php(3437): Maps\ParserHookSetup->Maps\{closure}()
#3 /data/www/html/wiki/includes/parser/Parser.php(3122): Parser->callParserFunction()
#4 /data/www/html/wiki/includes/parser/PPFrame_Hash.php(275): Parser->braceSubstitution()
#5 /data/www/html/wiki/includes/parser/Parser.php(2951): PPFrame_Hash->expand()
#6 /data/www/html/wiki/includes/parser/Parser.php(1609): Parser->replaceVariables()
#7 /data/www/html/wiki/includes/parser/Parser.php(723): Parser->internalParse()
#8 /data/www/html/wiki/includes/content/WikitextContentHandler.php(301): Parser->parse()
#9 /data/www/html/wiki/includes/content/ContentHandler.php(1721): WikitextContentHandler->fillParserOutput()
#10 /data/www/html/wiki/includes/content/Renderer/ContentRenderer.php(47): ContentHandler->getParserOutput()
#11 /data/www/html/wiki/includes/EditPage.php(4534): MediaWiki\Content\Renderer\ContentRenderer->getParserOutput()
#12 /data/www/html/wiki/includes/EditPage.php(4437): EditPage->doPreviewParse()
#13 /data/www/html/wiki/includes/EditPage.php(3143): EditPage->getPreviewText()
#14 /data/www/html/wiki/includes/EditPage.php(778): EditPage->showEditForm()
#15 /data/www/html/wiki/includes/actions/EditAction.php(73): EditPage->edit()
#16 /data/www/html/wiki/includes/actions/SubmitAction.php(38): EditAction->show()
#17 /data/www/html/wiki/includes/MediaWiki.php(542): SubmitAction->show()
#18 /data/www/html/wiki/includes/MediaWiki.php(322): MediaWiki->performAction()
#19 /data/www/html/wiki/includes/MediaWiki.php(904): MediaWiki->performRequest()
#20 /data/www/html/wiki/includes/MediaWiki.php(562): MediaWiki->main()
#21 /data/www/html/wiki/index.php(50): MediaWiki->run()
#22 /data/www/html/wiki/index.php(46): wfIndexMain()
#23 {main}
Product Version
MediaWiki 1.39.4
PHP 8.0.25 (apache2handler)
MySQL 8.0.26
Semantic MediaWiki 4.1.1 GPL-2.0-or-later
Maps 10.0.0 GPL-2.0-or-later
I am not sure why its throwing this error since all the required extensions and libs are installed (as per my knowledge). anybody knows why this behavior ?
Hi,
This got solved by myself, by cloning ParamProcessor from github and added those in Localsettings.php.
Thanks...
This template drives me crazy. Having this infobox, where I display in the last table row the map. It works for reading as planned, but if I start the Visual Editor I get a server error. Any idea?
<noinclude> {{#template_params:Land (property=Land)|Bundesland (property=Foaf:Bundesland)|Maps (label=Maps Location;property=Foaf:GeoLocaction)|Flughöhe (label=Max. Flughöhe in Meter;property=Foaf:Max Flughöhe)}} </noinclude><includeonly>{| style="width: 30em; font-size: 90%; border: 1px solid #aaaaaa; background-color: #f9f9f9; color: black; margin-bottom: 0.5em; margin-left: 1em; padding: 0.2em; float: right; clear: right; text-align:left;" ! style="text-align: center; background-color:#ccccff;" colspan="2" |<span style="font-size: larger;">{{PAGENAME}}</span> |- ! Land | [[Land::{{{Land|}}}]] |- ! Bundesland | [[Foaf:Bundesland::{{{Bundesland|}}}]] |- ! Maps Location | [[Foaf:GeoLocaction::{{{Maps|}}}]] |- ! Max. Flughöhe in Meter | [[Foaf:Max Flughöhe::{{{Flughöhe|}}}]] |- ! colspan="2" | {{#ask: [[Foaf:GeoLocaction::{{{Maps}}}]] | format=leaflet | ?Foaf:GeoLocaction | template=Google Maps Link}} | ! |{{#ask:[[Foaf:name::{{SUBJECTPAGENAME}}]]|format=list}} |} [[Kategorie:Spots]] </includeonly>
Just a general commment first. You're using what's called "in-text annotation", using square bracket/colon notation to set values, but it seems that will stop being supported at some point in the future. I don't think that's the issue at hand, but it is recommended to switch to #set notation regardless.
As for the error messsage I don't know. Does it work in VE if you don't include the Leaflet map?
Thanks for the note. I used PageForms to build the template. I need to change manual, but I see your point. Beside this, googlemaps instead of Leaflet doesn't change the error message.
What I meant is that you need to establish first whether or not your use of the Maps extension is what's causing the issue in VE, which you can do by removing the query entirely and see what happens. But maybe you tried that already.
I have an svg file containing some geo-referenced data from a GIS (QGIS). I like to use this as a layer or some kind of overlay to common maps in mediawiki. Extension:Maps is installed an works fine with #displaymap or |format=openlayers in semantic queries. Any hints are welcome.
Hi everyone.
Is there a way to modify the extension so that when one marker is clicked (and pop-up appears), all other pop-ups close?
Thanks