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!