MediaWiki:Wikiminiatlas.js: Difference between revisions
add the WMA to pseudo-title-coordinate items (such as those generated by Attached KML)
No edit summary |
(add the WMA to pseudo-title-coordinate items (such as those generated by Attached KML)) |
||
Line 400: | Line 400: | ||
mapbutton = $('<img>').attr('src', wc.buttonImage); | mapbutton = $('<img>').attr('src', wc.buttonImage); | ||
} | } | ||
mapbutton.attr( { | mapbutton.addClass('wmamapbutton').attr( { | ||
title: strings.buttonTooltip[language] || strings.buttonTooltip.en, | title: strings.buttonTooltip[language] || strings.buttonTooltip.en, | ||
alt: '' | alt: '' | ||
Line 547: | Line 547: | ||
// insert blue globe | // insert blue globe | ||
if( coord_list.length == 0 ) { | if( coord_list.length == 0 || ( !$('#coordinates').find('.wmamapbutton').length) ) { | ||
// determine center | // determine center | ||
alat = (la1+la2)/2; | alat = (la1+la2)/2; | ||
Line 562: | Line 562: | ||
// add mapbutton | // add mapbutton | ||
mapbutton = $('<img>') | mapbutton = $('<img>') | ||
.attr('src', wc.buttonImage) | .attr('src', wc.buttonImage).addClass('wmamapbutton') | ||
.bind( 'click', { param: | .bind( 'click', { param: | ||
alat + '_' + alon + '_' + | alat + '_' + alon + '_' + | ||
Line 569: | Line 569: | ||
}, showIFrame ); // zoomlevel! | }, showIFrame ); // zoomlevel! | ||
if( $('#coordinates').length ) { | if(!titlebutton ) { | ||
if( $('#coordinates').length ) { | |||
$('#coordinates').append(mapbutton); | |||
} else { | |||
$('<span id="coordinates">Map </span>').append(mapbutton).appendTo('#bodyContent'); | |||
} | |||
titlebutton = true; | titlebutton = true; | ||
} | } | ||
} | } | ||
} | } |