Extension talk:Maps

About this board

Post questions, bug reports and feature requests at https://github.com/JeroenDeDauw/Maps/issues.

The maintainer of the Maps extension does not check this page frequently!


The documentation for the Maps extension is located at https://www.semantic-mediawiki.org/wiki/Extension:Maps



Archive

Rothwell4217 (talkcontribs)

How would I go about adding the API key for OpenWeatherMap overlays?

Rothwell4217 (talkcontribs)

Apologies, I didn't see the notice about Github on the sidebar. I've asked this question here.

Reply to "OpenWeatherMap"

Disable or Remove the Category Footer

8
QuotesUK (talkcontribs)

How do I Disable or Remove the Category Footer?

"Category: Pages with a map rendered by the Maps extension"

This post was posted by QuotesUK, but signed as Quotes.

QuotesUK (talkcontribs)

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.

This post was posted by QuotesUK, but signed as Quotes.

46.114.26.29 (talkcontribs)

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.

Jeroen De Dauw (talkcontribs)

This is a hidden category. Why do you want to remove it?

Cavila (talkcontribs)

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.

AdSvS (talkcontribs)

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.

Reply to "Disable or Remove the Category Footer"

More than one GeoJSON source

1
Filburt (talkcontribs)

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!

Reply to "More than one GeoJSON source"

New installation gets Error 500 {{#display_map}}

3
63.161.160.181 (talkcontribs)

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.

63.161.160.181 (talkcontribs)

I'm posting an update to my own question. "tail /var/log/httpd/access_log" shows:

AH01071: Got error 'Primary script unknown'

178.25.216.164 (talkcontribs)

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?

Reply to "New installation gets Error 500 {{#display_map}}"

Image Overlay not aligned with geoJSON

5
104.247.242.51 (talkcontribs)

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}}

104.247.242.51 (talkcontribs)

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

104.247.242.51 (talkcontribs)

Ah! It's always aligning the bottom-left corner of the image to (0,0).

104.222.119.168 (talkcontribs)

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.

Jeroen De Dauw (talkcontribs)

What you are trying to do is indeed not possible without changes to Maps. Pull Requests and/or funding welcome.

Reply to "Image Overlay not aligned with geoJSON"

GeoJson: possibility to link to Wiki page?

3
Jvos2020 (talkcontribs)
Shyamal (talkcontribs)

Good question. Came here for the same feature.

Shyamal (talkcontribs)

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>' );

       }

Reply to "GeoJson: possibility to link to Wiki page?"

Call to undefined method ParamProcessor\Processor::setParameterDefinitions()

2
Testergt1302 (talkcontribs)

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 ?

Testergt1302 (talkcontribs)

Hi,

This got solved by myself, by cloning ParamProcessor from github and added those in Localsettings.php.


Thanks...

Map and SMW error on template

4
Ordovicium (talkcontribs)

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>

Cavila (talkcontribs)

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?

Ordovicium (talkcontribs)

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.

Cavila (talkcontribs)

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.

Reply to "Map and SMW error on template"

Use svg as an "overlay" in extension.maps

1
Carchaias (talkcontribs)

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.

Reply to "Use svg as an "overlay" in extension.maps"

Only one pop-up open at a time

1
Levimot (talkcontribs)

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

Reply to "Only one pop-up open at a time"
Return to "Maps" page.