Extension talk:Maps

Jump to navigation Jump to search

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


Bug with some special characters

Varlin (talkcontribs)

The bugs occured with country names in French in my case, but I guess it can occur in many non English languages. I give just one weird example :

{{#display_map:Côte dIvoire~Côte d'Ivoire}}

This displays two (!) markers on the map

Jeroen De Dauw (talkcontribs)

Just put the ' symbol rather than the HTML code. The HTML code does not work since it contains a semicolon, which is used to separate locations, hence the two markers.

Entering coordinates of a polygon

Jvos2020 (talkcontribs)

A point location is stored as e.g. 51.752367847997384, 5.0420263451101572

I want to record a polygon. Via the Forms extension I didn't see how to add a polygon. On the Leaflet map it looks like I only can add a point. So I manually added a series of coordinates to the page. But they aren't recognized. This is what I entered on the page (within a template):

|Parcel=269 |Place=MyPlace |Contour=51.752367847997384, 5.0420263451101572:

51.754842329817762, 5.0411433012562128:

51.754655975172547, 5.0408091395273438:

51.754514557197254, 5.0405474436405431:

51.752183917880750, 5.0413954272633106:

51.752340178664198, 5.0420365855845324:

51.752367847997384, 5.0420263451101572

And maybe to better illustrate my intention. See below the code to display some parcels.


51.752367847997384, 5.0420263451101572:

51.754842329817762, 5.0411433012562128:

51.754655975172547, 5.0408091395273438:

51.754514557197254, 5.0405474436405431:

51.752183917880750, 5.0413954272633106:

51.752340178664198, 5.0420365855845324:

51.752367847997384, 5.0420263451101572

~MyPlace - 269~Details about this parcel <link to page goes here>

51.75284463529357, 5.0431281849590839:

51.755482428207017, 5.0421830972897626:

51.754842329817762, 5.0411433012562128:

51.752367847997384, 5.0420263451101572:

51.752488841037191, 5.0425605930727997:

51.752520221076558, 5.0426892422115497:

51.752655384114384, 5.0426353602107286:

51.752733376720805, 5.0431660421107614:

51.75284463529357, 5.0431281849590839

~MyPlace - 268~Details about this parcel <link to page goes here>; | width=800 | height=400 | resizable=yes


However what I want is an #ask to retrieve the coordinates from alle the parcel pages.

What should I do to have a polygon on each page as a semantic property?

Reply to "Entering coordinates of a polygon"

GeoJson: possibility to link to Wiki page?

Jvos2020 (talkcontribs)
Reply to "GeoJson: possibility to link to Wiki page?"
Summary by Tgschaef

Old extensions are disrupting Maps from loading parser extensions. I was adding a note of my problematic extension to help others that come here looking for help with similar problems.

Cible30 (talkcontribs)

Hello, i'm trying to do a interactive query with page form that display a map with only the subject selected by the visitor. I've written all the codes but in the runquery page the map doesn't load. The code:

  • Template Mappa interattiva:

 [[Category:Campione generico]]
 ; {{#if: {{{specie|}}} | [[Specie::{{{specie|}}}]] |   }}
 ; {{#if: {{{genere|}}} | [[Genere::{{{genere|}}}]] |   }}
 ; {{#if: {{{sottofamiglia|}}} | [[Sottofamiglia::{{{sottofamiglia|}}}]] |   }}
 ; {{#if: {{{famiglia|}}} | [[Famiglia::{{{famiglia|}}}]] |   }}
 ; ?Coordinate
 ; icon=Campione generico.png
 | format=leaflet
 | fullscreen=yes
 | cluster=yes
 | clusterspiderfy=yes
 | clusterzoomonclick=yes
 | zoom=5
 | layers=OpenTopoMap,OpenStreetMap

  • Form:

{{{standard input|run query|label=Cerca}}}
{{{info|query form at top}}}
{{{for template|Mappa interattiva}}}

{| class="formtable"
! Specie:
| {{{field|specie|input type=combobox|existing values only}}}
! Genere:
| {{{field|genere|input type=combobox|existing values only}}}
! Sottofamiglia:
| {{{field|sottofamiglia|input type=combobox|existing values only}}}
! Famiglia:
| {{{field|famiglia|input type=combobox|existing values only}}}
{{{end template}}}

Are there some errors or is not possible to display maps in the special page runquery?

Tgschaef (talkcontribs)

Chiming in to say I have the same problems. You are not alone. Even a plain #ask format=leaflet or googlemap, that works on normal pages will not work on a Run Query template.

Jeroen De Dauw (talkcontribs)

Please make sure you are using Maps 7.20.1 or later. Let me know if the problem occurs on those versions as well.

DiscordiaChaos (talkcontribs)

I'm having the same issue after updating my wiki to MediaWiki 1.35.0, during the process I upgraded Semantic to 3.2.0 and Maps to 7.20.1. It stopped working when it had worked just fine previously. I did try using Semantic 3.1.0 instead, but with no luck.

Jeroen De Dauw (talkcontribs)

Thanks for reporting. Is there a live example of this bug somewhere that I can have a look at?

DiscordiaChaos (talkcontribs)

Yes. Note that my wiki is not open-edit, but you can still see the source code. For some reason it won't let me share links.

The map that is supposed to show:

wiki. rlsh. net/wiki/RLSH_Map_Test

Then the template that is supposed to be able to pull the coords from the location is this one, it is used on all the pages that the map code looks through:


Jeroen De Dauw (talkcontribs)
DiscordiaChaos (talkcontribs)

Very strange. I'll try turning off extensions to see if I could fix it that way and report back. Thank you for the very helpful clue!

DiscordiaChaos (talkcontribs)

Alright, so I commented out this line:

require_once "$IP/extensions/DynamicPageList/DynamicPageList.php";

It was Extension:DynamicPageList (third-party) that I was using, but I don't recall for what exact purpose.

It didn't start working again immediately, but I waited a bit and it's back up! Thank you so much.

Tgschaef (talkcontribs)

Chiming in again to say I had a similar problem of an old extension loaded with the "require_once" was interrupting parser extensions from being loaded. Specifically Maps parser extensions. My culprit was Extension:SimpleTable. It has been fixed by someone and posted at: https://github.com/jrbray1/SimpleTable.

Jvos2020 (talkcontribs)

I can't get non-default icons working. For example in an semantic query:

| icon=Red-marker.png

and having Red-marker.png in \Maps\resources\lib\leaflet\images, it does not work.

Felix Englisch (talkcontribs)

In my wiki installation, custom icons are working. Yet, I didn't upload them to the mentioned path, but simply as files in the wiki frontend (like uploading an image). Your syntax looks correctly, so it should work, if you upload them as described.

Jvos2020 (talkcontribs)
Reply to "Can't get custom icon to work"

CSS class for better look and mobile responsiveness

Felix Englisch (talkcontribs)

Although I am a big fan of this extension, I was dissatisfied with how the leaflet maps were displayed. Unlike photos or videos, the appear on the left side of the screen, and even worse, the map normally goes over the edge of mobile screens. So, I decided to create a new CSS class and put all my maps into a div element with this class. Since I am quite happy with this solution, I'd like to share it with you.

.map {
   float: right;
   border: 1px solid #c8ccd1; /* Same as picture thumbnails*/
   padding: 3px;
   background-color: #f8f9fa;
   min-width: 300px; /* With this, you can set the inline width property of the map to 100% */
   margin-bottom: 20px;
   clear: both; /* To avoid two elements next to each other - force them below another instead*/
   width: min-content; /* To force the caption to break lines if it is longer than the map*/

.map > p {
    font-size: 94%; /* Smaller caption, same as picture captions */
    padding: 3px 0 0 3px;

/* Make map mobile-friendly by forcing it to stretch 100% width */
@media only screen and (max-width: 750px) {
	.map {
		float: left; 
		width: 100%;
	.leaflet-container {
		width: 100% !important; /* Override the (inline) width property set when writing e. g. {{#display_map: ... |width=400px}}, because this could be too large for mobile screens */

In the article, I write the following:

<div class="map">
{{#display_map:... |fullscreen=on|width=100%|height=300px}}
Description of the map (caption)
Reply to "CSS class for better look and mobile responsiveness"
Mbolatsara (talkcontribs)

I have a Unix server running MW and full root access but cannot get Composer to run without error for some reason. The composer command complain about a missing lock file, but where? Is it possible to install Maps without Composer? If so, can anyone kindly give me some tips on what configuration files should be modified after having downloaded and placed Maps in the extensions directory?

Felix Englisch (talkcontribs)
Felix Englisch (talkcontribs)

So, you still need Composer, but it's sufficient to run it locally and then manually upload the directories from /vendor

Reply to "Installing without Composer?"
EFFemeer (talkcontribs)

Installation was successful but when I include {_{#display_map:center=Brandenburg Gate, Berlin, Germany}_} (without underscores!) on a page I only get {_{#display_map:center=Brandenburg Gate, Berlin, Germany}_} as a result.

Product Version
MediaWiki 1.35.0
PHP 7.4.12 (apache2handler)
MySQL 5.7.32-0ubuntu0.18.04.1
ICU 65.1

Installed extensions

Semantic extensions
Extension Version
Semantic MediaWiki 3.2.0
Special pages
Extension Version
BlockAndNuke 1.1 (cf48015) 09:18, 2 October 2019
Collection 1.8.0 (17850c6) 09:20, 27 September 2019
Confirm User Accounts (3ffa446) 10:05, 3 October 2019
ContactPage 2.3 (48b0c07) 10:17, 13 September 2019
Data Transfer 1.0.1 (1fc1c61) 11:42, 20 September 2019
MaintenanceShell 0.5.0 (038586a) 10:03, 12 September 2019
Mass Edit via Regular Expressions 8.4.0 (b46d2bf) 19:35, 27 August 2020
Nuke 1.3.0
Page Forms 5.0-alpha (9862e06) 15:37, 11 November 2020
Replace Text 1.4.1 (e027d41) 03:48, 11 July 2020
Extension Version
VisualEditor 0.1.2 (10ac245) 05:46, 11 September 2020
WikiEditor 0.5.2
Parser hooks
Extension Version
Arrays 2.2.0 (40737de) 09:27, 1 August 2019
Babel 1.11.1 (33fc3fd) 09:23, 1 October 2019
Cargo 2.7 (aad4151) 18:10, 10 November 2020
Cite 1.0.0
DynamicPageList3 3.3.3
Embed Document 0.13
GoogleDocs4MW 1.4 (83c0ccd) 10:01, 12 September 2019
Header Tabs 1.3 (1934f9c) 01:51, 10 July 2020
InputBox 0.3.0
InteractiveTimeline 1.9.0
Javascript Slideshow 2.0.0
Maps 7.20.1
Math 3.0.0
NamespaceHTML 0.2 (edde7aa) 10:19, 13 September 2019
NoTitle 0.4.0 (8bc61aa) 02:19, 3 August 2019
ParserFunctions 1.6.0 (59a9135) 19:43, 10 July 2020
PDFEmbed 2.0.3
TimelineTable 2.1 (9130229) 04:32, 18 July 2019
VideoPlayer 1
Widgets 1.4.0 (6392516) 08:52, 7 April 2020
YouTube 1.9.3 (a0bbd39) 10:21, 2 September 2019
Media handlers
Extension Version
PDF Handler – (8b39cdd) 13:57, 13 July 2020
Spam prevention
Extension Version
ConfirmEdit 1.6.0
Extension Version
Extension Version
AutoCreateCategoryPages 1.0.0 (2a5f5e7) 20:14, 24 May 2015
CollapsibleVector 0.1.10 (3bd32f3) 10:29, 25 August 2019
Google Analytics Integration 3.0.1 (6441403) 09:12, 6 August 2019
ParserHooks 1.6.1
Page previews (375d27b) 16:18, 23 September 2019
Validator 2.2.1

Installed libraries

Library Version License
smarty/smarty 3.1.36 LGPL-3.0
Jeroen De Dauw (talkcontribs)
EFFemeer (talkcontribs)

Thanks of lot. Videoplayer stood in the way!

Reply to "Nothing happens"

imageoverlays - no equivalent for leaflet?

NeirinD (talkcontribs)


maybe I am just configuring the parameters the wrong way. I would like to overlay some parts of the map with images of my own, so I can use the geocoding to show where things are, but have them shown on the image instead of the normal map-base.

The imageoverlays parameter (googlemaps3) seems like it would to the trick, but I just can't get the overlays to work in Leaflet (OSM). From the LeafletService.php/DefaultSettings.php it seems like one can only use predetermined overlays for the maps.

Is there a workaround or am I stuck with Gmaps? Thanks

Jeroen De Dauw (talkcontribs) (talkcontribs)

Is there a way to configure the Maps extension to use a host source per layer? For examples:







Jeroen De Dauw (talkcontribs)

Not at the moment. I if you a budget I can add it. Or you are welcome to submit a pull request.