<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://visualdata.idea-sketch.com/index.php?action=history&amp;feed=atom&amp;title=Widget%3ADisplay_map</id>
	<title>Widget:Display map - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://visualdata.idea-sketch.com/index.php?action=history&amp;feed=atom&amp;title=Widget%3ADisplay_map"/>
	<link rel="alternate" type="text/html" href="https://visualdata.idea-sketch.com/index.php?title=Widget:Display_map&amp;action=history"/>
	<updated>2026-05-12T18:37:29Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.3</generator>
	<entry>
		<id>https://visualdata.idea-sketch.com/index.php?title=Widget:Display_map&amp;diff=2978&amp;oldid=prev</id>
		<title>Uschuetzenmeister: Created page with &quot;&lt;noinclude&gt;__NOTOC__ This is the &lt;em&gt;widget: display map&lt;/em&gt;. It displays an interactive map on the page where it is called. &lt;br /&gt;&lt;br /&gt;  Call: &lt;em&gt;&lt;nowiki&gt;{{#widget: display map |markerdata=array of JSON objects |height=integer |width = integer}}&lt;/nowiki&gt;&lt;/em&gt;&lt;br/&gt;&lt;br/&gt; Parameters:&lt;br/&gt; *&lt;em&gt;markerdata&lt;/em&gt;: required, a JSON Object that is created through a template (see e.g. &lt;em&gt;template:webmo map main page&lt;/em&gt; and below for further info) or directly to the widget l...&quot;</title>
		<link rel="alternate" type="text/html" href="https://visualdata.idea-sketch.com/index.php?title=Widget:Display_map&amp;diff=2978&amp;oldid=prev"/>
		<updated>2024-04-06T12:26:41Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;noinclude&amp;gt;__NOTOC__ This is the &amp;lt;em&amp;gt;widget: display map&amp;lt;/em&amp;gt;. It displays an interactive map on the page where it is called. &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;  Call: &amp;lt;em&amp;gt;&amp;lt;nowiki&amp;gt;{{#widget: display map |markerdata=array of JSON objects |height=integer |width = integer}}&amp;lt;/nowiki&amp;gt;&amp;lt;/em&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt; Parameters:&amp;lt;br/&amp;gt; *&amp;lt;em&amp;gt;markerdata&amp;lt;/em&amp;gt;: required, a JSON Object that is created through a template (see e.g. &amp;lt;em&amp;gt;template:webmo map main page&amp;lt;/em&amp;gt; and below for further info) or directly to the widget l...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;noinclude&amp;gt;__NOTOC__&lt;br /&gt;
This is the &amp;lt;em&amp;gt;widget: display map&amp;lt;/em&amp;gt;. It displays an interactive map on the page where it is called. &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Call: &amp;lt;em&amp;gt;&amp;lt;nowiki&amp;gt;{{#widget: display map |markerdata=array of JSON objects |height=integer |width = integer}}&amp;lt;/nowiki&amp;gt;&amp;lt;/em&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Parameters:&amp;lt;br/&amp;gt;&lt;br /&gt;
*&amp;lt;em&amp;gt;markerdata&amp;lt;/em&amp;gt;: required, a JSON Object that is created through a template (see e.g. &amp;lt;em&amp;gt;template:webmo map main page&amp;lt;/em&amp;gt; and below for further info) or directly to the widget like: [{marker1 data},{marker2 data},{marker3 data}]&amp;lt;br /&amp;gt;&lt;br /&gt;
*&amp;lt;em&amp;gt;height&amp;lt;/em&amp;gt;: optional, integer in pixels, e.g.: 500; defaults to 700&amp;lt;br/&amp;gt;&lt;br /&gt;
*&amp;lt;em&amp;gt;width&amp;lt;/em&amp;gt;: optional, integer in pixels, e.g.: 500; defaults to 100%&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By sending different data to the widget you may modify the map that gets displayed. The data comes in the JSON format. If ineterested, please check out the gentle [https://github.com/edsu/json-intro/blob/master/python.md json introduction].&lt;br /&gt;
&lt;br /&gt;
The data set with the parameter &amp;lt;em&amp;gt;markerdata&amp;lt;/em&amp;gt; is an array of JSON objects. It works like an array of records. Each record represents a marker and contains data belonging to that marker. The data contained in &amp;lt;em&amp;gt;markerdata&amp;lt;/em&amp;gt; could be the coordinates or any HTML content that can be displayed as a popup. Or a date to check against the current date to display expired markers differently.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, the following abstract array contains data for three markers: &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;em&amp;gt;[{marker1 data},{marker2 data},{marker3 data}]&amp;lt;/em&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let&amp;#039;s take the first record  {marker1 data} as an exmaple. In its most basic form it needs to look like this:&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;em&amp;gt;{&amp;quot;coordinates&amp;quot;: &amp;quot;34.32, -32.333&amp;quot;}&amp;lt;/em&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will draw a map and place a blue marker icon at the location. Extending the record like this:&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
1) &amp;lt;em&amp;gt;{&amp;quot;coordinates&amp;quot;: &amp;quot;34.32, -32.333&amp;quot;, &amp;quot;popupContent&amp;quot;:&amp;quot;Test&amp;quot;}&amp;lt;/em&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
2) &amp;lt;em&amp;gt;{&amp;quot;coordinates&amp;quot;: &amp;quot;34.32, -32.333&amp;quot;, &amp;quot;projectEndDate&amp;quot;:&amp;quot;2012-07-03&amp;quot;}&amp;lt;/em&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
3) &amp;lt;em&amp;gt;{&amp;quot;coordinates&amp;quot;: &amp;quot;34.32, -32.333&amp;quot;, &amp;quot;pathToMarkerIconCurrent&amp;quot;:&amp;quot;http://domain.xu/test.jpg&amp;quot;, &amp;quot;pathToMarkerIconExpired&amp;quot;:&amp;quot;http://domain.xu/test.jpg&amp;quot;, }&amp;lt;/em&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1) add a popup to the marker which displays the content &amp;quot;Test&amp;quot;. You can use HTML and add images and tables. &amp;lt;br/&amp;gt;&lt;br /&gt;
2) evaluate each marker against the current date and display a different marker if projectEndDate &amp;lt; now&amp;lt;br/&amp;gt;&lt;br /&gt;
3) change the default icons to the ones provided found at the url &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Below is an example array which contains all available options. It will put two markers on a map with custom icons. The markers will have different icons depending on whether the dates are in the past or not. The names &amp;lt;em&amp;gt;&amp;quot;coordinates&amp;quot;&amp;lt;/em&amp;gt;, &amp;lt;em&amp;gt;&amp;quot;projectEndDate&amp;quot;&amp;lt;/em&amp;gt;, &amp;lt;em&amp;gt;&amp;quot;popupContent&amp;quot;&amp;lt;/em&amp;gt;, &amp;lt;em&amp;gt;&amp;quot;pathToMarkerIconCurrent&amp;quot;&amp;lt;/em&amp;gt;, &amp;lt;em&amp;gt;&amp;quot;pathToMarkerIconExpired&amp;quot;&amp;lt;/em&amp;gt; are fixed an must not be changed.&lt;br /&gt;
&lt;br /&gt;
[&lt;br /&gt;
{&amp;quot;coordinates&amp;quot;: &amp;quot;34.32, -32.333&amp;quot;, &amp;quot;popupContent&amp;quot;:&amp;quot;test&amp;quot;, &amp;quot;pathToMarkerIconCurrent&amp;quot;:&amp;quot;http://domain.xu/test.jpg&amp;quot;, &amp;quot;pathToMarkerIconExpired&amp;quot;:&amp;quot;http://domain.xu/test.jpg&amp;quot;,&amp;quot;projectEndDate&amp;quot;:&amp;quot;2018-07-03&amp;quot;},&lt;br /&gt;
&lt;br /&gt;
{&amp;quot;coordinates&amp;quot;: &amp;quot;24.32, -31.333&amp;quot;, &amp;quot;popupContent&amp;quot;:&amp;quot;test2&amp;quot;, &amp;quot;pathToMarkerIconCurrent&amp;quot;:&amp;quot;http://domain.xu/test.jpg&amp;quot;, &amp;quot;pathToMarkerIconExpired&amp;quot;:&amp;quot;http://domain.xu/test.jpg&amp;quot;,&amp;quot;projectEndDate&amp;quot;:&amp;quot;2012-07-03&amp;quot;}&lt;br /&gt;
]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Created by [idea-sketch.com idea-sketch.com]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;includeonly&amp;gt;&lt;br /&gt;
&amp;lt;!--{counter name=&amp;quot;counterMap&amp;quot; assign=&amp;quot;countMap&amp;quot;}--&amp;gt;&lt;br /&gt;
&amp;lt;!--{math equation=&amp;#039;rand(0,1000)&amp;#039; assign=&amp;quot;randomValue&amp;quot;}--&amp;gt;&lt;br /&gt;
&amp;lt;!--{assign var=time value=time()}--&amp;gt;&lt;br /&gt;
&amp;lt;!--{$ID=&amp;quot;$countMap-$time-$randomValue&amp;quot;}--&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;map-&amp;lt;!--{$ID|escape:&amp;#039;html&amp;#039;}--&amp;gt;&amp;quot; style=&amp;quot;width: &amp;lt;!--{$width|default:&amp;#039;100%&amp;#039;}--&amp;gt;; height: &amp;lt;!--{$height|default:&amp;#039;700px&amp;#039;}--&amp;gt;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
// defer script execution until the mediawiki loader and jQuery are available&lt;br /&gt;
RLQ.push([[], function () {&lt;br /&gt;
  mw.loader.using(&amp;#039;ext.iswiki.display_map&amp;#039;).then( function() {&lt;br /&gt;
                      var mapId = &amp;quot;&amp;lt;!--{$ID|escape:&amp;#039;html&amp;#039;}--&amp;gt;&amp;quot;;&lt;br /&gt;
                      var markerData = [&amp;lt;!--{$markerdata|default:&amp;#039;&amp;#039;}--&amp;gt;];                      &lt;br /&gt;
                      var polygonData = [&amp;lt;!--{$polygondata|default:&amp;#039;&amp;#039;}--&amp;gt;];                      &lt;br /&gt;
                      var widgetParams = {isGroupCoordinates:false};&lt;br /&gt;
                      drawmap(mapId, markerData, polygonData, widgetParams);&lt;br /&gt;
                   });&lt;br /&gt;
}]);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/includeonly&amp;gt;&lt;/div&gt;</summary>
		<author><name>Uschuetzenmeister</name></author>
	</entry>
</feed>