I think it is a bug. When using a semantic query like
{{#ask: [[Category:some_category]]
| format=googlemaps
| pagelabel=yes
}}
the titles don't appear inline on the map.
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
I think it is a bug. When using a semantic query like
{{#ask: [[Category:some_category]]
| format=googlemaps
| pagelabel=yes
}}
the titles don't appear inline on the map.
Hi, the parameters title and label do not seem to work.
{{#display_map: 51.68137,7.81964~mytitle~mylabel}}
works
{{#display_map: 51.68137,7.81964 |title=mytitle |label=mylabel}}
does not.
What am I doimg wrong? Or is it an error in maps?
Also I do not get
{{#display_map: 51.68137,7.81964 |centre=51.6,7.8}}
i.e. map center at a different position than the icon running. All for leaflet.
Hello,
we use a lot of maps on www.hammwiki.info. We're now migrating from multimaps to maps, since multimaps doesn't seem to be maintained any longer.
We using own icons to be shown in #display_map: and that principally works, but:
The only possibility I found out is to use a fully qualified url to the icon file, e.g. |icon=https://<domain.tld>/<iconfolder>/<iconfile>.png
Is there somewhat to use path to the icon? What's the base folder of this? Like |icon=<mediawiki installation folder/somewhat folder/somewhat icon file?
And: is it possible to show more than one custom icon on a map with multiple positions? if yes, how?
Thanks and Regards
Frank
[Edited]
Are you sure a full path is required? If NewYorkSubwaySmall.jpg
or perhaps File:NewYorkSubwaySmall.jpg
doesn't work, you could try something like {{filepath:NewYorkSubwaySmall.jpg|15px}}
. See Help:Magic words for guidance on how to use filepath.
I found out I just can upload the iconfile as an image and use the image name. Sorry, did not think of that before.
Remains: Multiple custom icons?
The documentation has a section on custom markers and gives the following example:
{{#display_map: Berlin~The city Berlin~Berlin is a really nice city and there is plenty of Club Mate~Red-marker.png; }}
On first try it does not work, it show display_maps' default marker and not the own one.
{{#display_map: Pauluskirche Hamm~Pauluskirche~MarkerHML.png;}}
Thank anyway, I'll do some more tests.
The marker must be in the fourth position, not third. Try this (without description):
{{#display_map: Pauluskirche Hamm~Pauluskirche~~MarkerHML.png; }}
Jepp, that works, thanks
unfortunatelynot without title like
{{#display_map: Pauluskirche Hamm~~~MarkerHML.png; }}
I'm looking to possibly use this to plot out planetary systems that have their data coordinates being on a 2d plane.
In no basic terms a map of this: sarna.net/wiki/File:3151_Known_Universe_(Sarna).svg
and have the points containing the other semantic information.
I enabled the visual Leaflet map editor per the instructions for a test page. The test page contained:
{{#display_map: center=Oakland,CA | geojson=GeoJson:TestMap}}
Things almost worked correctly, except the resulting longitude values were all 360 too small. For example, the first coordinate was -482.262111 instead of -122.26111.
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"title": "lake merritt",
"description": ""
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
-482.262111,
37.810626
],
[
-482.260566,
37.806523
],
[
-482.258163,
37.804387
],
[
-482.256274,
37.805641
],
[
-482.255416,
37.807099
],
[
-482.249494,
37.808354
],
[
-482.251168,
37.804523
],
[
-482.253356,
37.804251
],
[
-482.254601,
37.801776
],
[
-482.254601,
37.800826
],
[
-482.257133,
37.799911
],
[
-482.259192,
37.798588
],
[
-482.261338,
37.799504
],
[
-482.26151,
37.801912
],
[
-482.260566,
37.804285
],
[
-482.261596,
37.805167
],
[
-482.263312,
37.807167
],
[
-482.262111,
37.810626
]
]
]
}
}
]
}
It has to do with "which" Oakland, CA I zoom in on initially. When the GeoJson page is first created and the visual map editor comes up, it shows a map of the whole world, repeating horizontally. If I zoom in to the the copy towards the left, the coordinates are off by -360. If I zoom in to the one towards the right, the coordinates are off by +360. If I scroll further left or right on the world map, the latitudes are off by larger amounts.
If I have a Maps template, e.g., #coordinates:
on page, when I try to use the Visual Editor for that page, I get "Error contacting the Parsoid/RESTBase server (HTTP 500)" when I try to save the page. A page with nothing but {{#coordinates:37.8012055000000089,-122.2531170280909976}}
shows the problem.
The error.log ends up with a bunch of things in it along the lines of:
[Mon Jul 11 18:05:01.677269 2022] [:error] [pid 329230:tid 3645043091200] [client xx.xx.xx.xx:52242] [client xx.xx.xx.xx] ModSecurity: Warning. Pattern match "(?:;|\\\\{|\\\\||\\\\|\\\\||&|&&|\\\\n|\\\\r|\\\\$\\\\(|\\\\$\\\\(\\\\(|`|\\\\${|<\\\\(|>\\\\(|\\\\(\\\\s*\\\\))\\\\s*(?:{|\\\\s*\\\\(\\\\s*|\\\\w+=(?:[^\\\\s]*|\\\\$.*|\\\\$.*|<.*|>.*|\\\\'.*\\\\'|\\".*\\")\\\\s+|!\\\\s*|\\\\$)*\\\\s*(?:'|\\")*(?:[\\\\?\\\\*\\\\[\\\\]\\\\(\\\\)\\\\-\\\\|+\\\\w'\\"\\\\./\\\\\\\\]+/)?[\\\\\\\\'\\"]*(?:l[\\\\\\\\'\\"]* ..." at ARGS:html. [file "/dh/apache2/template/etc/mod_sec3_CRS/REQUEST-932-APPLICATION-ATTACK-RCE.conf"] [line "122"] [id "932100"] [msg "Remote Command Execution: Unix Command Injection"] [data "Matched Data: ;function found within ARGS:html: <!doctype html><html prefix=\\x22dc: http://purl.org/dc/terms/ mw: http://mediawiki.org/rdf/\\x22 about=\\x22https://wiki.ouroakland.net/Special:Redirect/revision/427\\x22><head prefix=\\x22mwr: https://wiki.ouroakland.net/Special:Redirect/\\x22><meta charset=\\x22utf-8\\x22><meta property=\\x22mw:pageId\\x22 content=\\x22121\\x22><meta property=\\x22mw:pageNamespace\\x22 content=\\x220\\x22><link rel=\\x22dc:replaces\\x22 resource=\\x22mwr:revision/0\\x22><meta property=\\x22m..."] [severity "CRITICAL"] [ver "OWASP_ [hostname "wiki.ouroakland.net"] [uri "/oaklandwiki/rest.php/wiki.ouroakland.net/v3/transform/html/to/wikitext/TestMaps/427"] [unique_id "YszIvUki-DtamwvGJ51NqgAAAAo"]
I can provide more log info if that is helpful.
thanks,
Gene
Versions are:
MediaWiki | 1.38.1 |
PHP | 8.0.2 (cgi-fcgi) |
VisualEditor | 0.1.2 |
Maps | 9.0.7 |
I see in the examples how with Semantic MediaWiki a query can ask for pages in a particular category that have a given property like Has coordinates
, and create a map of all those pages.
Is it possible to make a combined map of pages in a particular category that have different kinds of maps? That is, some that are single coordinates, and some that are polygons? The use case is a wiki with pages for different things in a neighborhood. Some are single coordinates (for example, the address of a historical building), some are larger areas (for example, a park or geographical feature), and some are lines (for example a street). On the page for the neighborhood, in addition to a list of the pages in that neighborhood, it would be nice to have a combined map, too.
thanks,
Gene
Tracked with issue 704
I know this is a conflict somewhere between the Leaflet maps, the Map extension, MediaWiki, and the MonoBook skin involving CSS, but I don't know how to figure it where exactly the problem lies.
I have a new MediaWiki install (version 1.38.1, default skin = monobook) with the Maps extension (version 9.0.7), and maps I've added to pages work as described on the documentation pages.
The MonoBook skin with responsive mode checked mostly behaves as expected. But when a page gets narrow (as on mobile), about 550px or less, images and maps go from their normal left-aligned behavior to full width. Images become centered (OK), and maps become full width (OK), but the OSM map tiles disappear.
Part of what makes this more confusing to me is that the polygon for the map doesn't disappear, just the map tiles.
You can see this behavior here:
wiki.ouroakland.net/oaklandwiki/index.php/Peralta_Heights
Either resize your browser window narrower until the tiles disappear, or bring up the developer tools in Chrome, et al, toggle the device toolbar, then resize the simulator window until the tiles disappear.
I've tried both with an enclosing div and without. The results are the same -- below a certain width, the map tiles disappear. Currently the map is without a div.
It will be great if you could do it. Thus you could also provide more info if need be. Thanks a lot.
If you are using the Maps extension in combination with Extension:WikiEditor, you might want to make it easier for your users to insert a map. It is quite easy to add an icon to the toolbar which automatically inserts the code snippet required for embedding. Simply add the following to you LocalSettings.php:
$wgUseSiteJs = true;
Then, open the page "MediaWiki:Common.js" on your wiki and insert the following:
var customizeToolbar = function () {
$('#wpTextbox1').wikiEditor('addToToolbar', {
section: 'advanced',
group: 'insert',
tools: {
"Map": {
label: 'Insert map',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/b/b4/OOjs_UI_icon_map-ltr.svg',
action: {
type: 'encapsulate',
options: {
pre: '{{#display_map:',
peri: "Example street 1, Berlin~'''Heading'''~Short description; optional: 2nd marker",
post: '|fullscreen=on}}'
}
}
}
}
});
};
/* Check if view is in edit mode and that the required modules are available. Then, customize the toolbar … */
if ( [ 'edit', 'submit' ].indexOf( mw.config.get( 'wgAction' ) ) !== -1 ) {
mw.loader.using( 'user.options' ).then( function () {
if ( mw.user.options.get( 'usebetatoolbar' ) == 1 ) {
$.when(
mw.loader.using( 'ext.wikiEditor' ), $.ready
).then( customizeToolbar );
}
} );
}
Of course, you can change the default parameters of the map and also the icon. Just visit https://commons.wikimedia.org/wiki/Main_Page and look for a better one. And for more information about editing the toolbar, see Extension:WikiEditor/Toolbar customization.
Have fun!
Thanks! This is really interesting, and I might well add it directly to the Maps extension. Tracked here https://github.com/JeroenDeDauw/Maps/issues/635
@Jeroen De Dauw -- any update on adding this to the Maps extension? It seems very useful to add directly to the Maps extension.
I tried the directions above on my new wiki, but when I try to save the Javascript, I get "Internal Server Error". I can make other changes to the file, so it doesn't seem to be a permissions thing.
Tracked on GitHub: issue 697
It seems the Google maps don't display anymore, even on the example page. The console reports a JS error:
not a LatLngBounds or LatLngBoundsLiteral: not an Object
Can someone else confirm?
Coincidentally an issue was created for this on GitHub: issue 697. Let's see how that goes.