Widget:Google Maps: Unterschied zwischen den Versionen
Aus WikiSpeicher
Admin (Diskussion | Beiträge) |
Admin (Diskussion | Beiträge) |
||
Zeile 36: | Zeile 36: | ||
var createMarker = function(markerLatLng,MarkerTitle,markerPopup) { | var createMarker = function(markerLatLng,MarkerTitle,markerIcon,markerPopup) { | ||
var marker=new google.maps.Marker({position: markerLatLng, map:map, title:MarkerTitle}); | var marker=new google.maps.Marker({ | ||
position: markerLatLng, | |||
map:map, | |||
title:MarkerTitle, | |||
icon: markerIcon | |||
}); | |||
if (markerPopup) { | if (markerPopup) { | ||
marker.addListener('click', function () { | marker.addListener('click', function () { | ||
Zeile 48: | Zeile 53: | ||
} | } | ||
<!--{foreach from=$marker item=m}--> | <!--{foreach from=$marker item=m}--> | ||
var markerIcon='https://maps.google.com/mapfiles/ms/icons/red-dot.png'; | |||
<!--{if isset($m.icon)}-->markerIcon='<!--{$m.icon|validate:url}-->';<!--{/if}--> | |||
var markerLatLng = new google.maps.LatLng('<!--{$m.lat|escape:'quotes'}-->', '<!--{$m.lng|escape:'quotes'}-->'); | var markerLatLng = new google.maps.LatLng('<!--{$m.lat|escape:'quotes'}-->', '<!--{$m.lng|escape:'quotes'}-->'); | ||
var markerPopup=""; | var markerPopup=""; | ||
<!--{if isset($m.text)}-->markerPopup='<!--{$m.text|escape:'quotes'}-->';<!--{/if}--> | <!--{if isset($m.text)}-->markerPopup='<!--{$m.text|escape:'quotes'}-->';<!--{/if}--> | ||
var marker = new createMarker(markerLatLng,'<!--{$m.title|escape:'quotes'}-->',markerPopup | var marker = new createMarker(markerLatLng,'<!--{$m.title|escape:'quotes'}-->',markerIcon,markerPopup); | ||
<!--{/foreach}--> | <!--{/foreach}--> | ||
} | } |
Version vom 29. August 2018, 19:32 Uhr
This widget allows you to add Google Maps widget to your wiki page.
Created by Sergey Chernyshev
Using this widget
For information on how to use this widget, see widget description page on MediaWikiWidgets.org.
Copy to your site
To use this widget on your site, just install MediaWiki Widgets extension and copy the full source code of this page to your wiki as page Widget:Google Maps.