வார்ப்புரு:Graph:Street map with marks
&lt;includeonly&gt;{{safesubst:#tag:templatestyles||src=&quot;Graph:Street map with marks/styles.css&quot;}}{{#tag:{{#if:{{{debug|}}}|syntaxhighlight|graph}}|&lt;/includeonly&gt;&lt;noinclude&gt;{{documentation}}&lt;syntaxhighlight lang=html&gt;&lt;graph&gt;&lt;/syntaxhighlight&gt;{{#tag:syntaxhighlight|&lt;/noinclude&gt;
 {
   //
   // ATTENTION: This code is maintained at https://www.mediawiki.org/wiki/Template:Graph:Street_map_with_marks
   //            Please do not modify it anywhere else, as it may get copied and override your changes.
   //            Suggestions can be made at https://www.mediawiki.org/wiki/Template_talk:Graph:Street_map_with_marks
   //
   // Template translation is in https://commons.wikimedia.org/wiki/Data:Original/Template:Graphs.tab
   //
   &quot;version&quot;: 2, &quot;width&quot;:{{{width|400}}}, &quot;height&quot;: {{{height|{{{width|300}}}}}}, &quot;padding&quot;: {{{padding|0}}},
   &quot;signals&quot;:[
     // These signals allow us to quickly move the map within the image, e.g. to leave space for the legend
 {{#if:{{{showLegend|}}}|
     {&quot;name&quot;:&quot;legendWidth&quot;, &quot;init&quot;: {&quot;expr&quot;: &quot;{{{legendWidth|100}}}&quot;} },
 |
     {&quot;name&quot;:&quot;legendWidth&quot;, &quot;init&quot;: {&quot;expr&quot;: &quot;0&quot;} },
 }}
     {&quot;name&quot;:&quot;legendHeight&quot;, &quot;init&quot;: {&quot;expr&quot;: &quot;height&quot;} },
     {&quot;name&quot;:&quot;imgWidth&quot;, &quot;init&quot;: {&quot;expr&quot;: &quot;width-legendWidth&quot;} },
     {&quot;name&quot;:&quot;imgHeight&quot;, &quot;init&quot;: {&quot;expr&quot;: &quot;height&quot;} },
     {&quot;name&quot;:&quot;imgXC&quot;, &quot;init&quot;: {&quot;expr&quot;: &quot;imgWidth/2&quot;} },
     {&quot;name&quot;:&quot;imgYC&quot;, &quot;init&quot;: {&quot;expr&quot;: &quot;imgHeight/2&quot;} },
     {&quot;name&quot;:&quot;imgTileSize&quot;, &quot;init&quot;: {&quot;expr&quot;: &quot;256&quot;} },
     {&quot;name&quot;:&quot;imgLat&quot;, &quot;init&quot;: {&quot;expr&quot;: &quot;{{{lat|40.347}}}&quot;} },
     {&quot;name&quot;:&quot;imgLon&quot;, &quot;init&quot;: {&quot;expr&quot;: &quot;{{{lon|47.260}}}&quot;} },
     {&quot;name&quot;:&quot;imgZoom&quot;, &quot;init&quot;: {&quot;expr&quot;: &quot;{{{zoom|6}}}&quot;} },
     {&quot;name&quot;:&quot;picWidth&quot;, &quot;init&quot;: {&quot;expr&quot;: &quot;180&quot;} },
     {&quot;name&quot;:&quot;picHeight&quot;, &quot;init&quot;: {&quot;expr&quot;: &quot;picWidth/2&quot;} },
     {&quot;name&quot;:&quot;picXC&quot;, &quot;init&quot;: {&quot;expr&quot;: &quot;imgWidth-(picWidth/2)&quot;} },
     {&quot;name&quot;:&quot;picYC&quot;, &quot;init&quot;: {&quot;expr&quot;: &quot;imgHeight-(picHeight/2)&quot;} },
     {&quot;name&quot;:&quot;showMiniMap&quot;, &quot;init&quot;: {&quot;expr&quot;: &quot;{{{minimap|imgZoom&gt;4 &amp;&amp; imgWidth&gt;200 &amp;&amp; imgHeight&gt;110}}}&quot;} }
   ],
   &quot;data&quot;: [
     {
       &quot;name&quot;: &quot;data&quot;,
 {{#if:{{{wdqs|}}}|
       // If query parameter is given, use it to get data from Wikidata Query service
       // Assume that it contains &quot;coord&quot; field with the geo coordinates
       &quot;url&quot;: &quot;wikidatasparql:///?query={{urlencode:{{{wdqs|}}}|PATH}}&quot;,
       &quot;format&quot;: {&quot;type&quot;: &quot;json&quot;},
 |{{#if:{{{table|}}}|
       // Use tabular data source
       &quot;url&quot;: &quot;tabular:///{{urlencode:{{{table}}}|PATH}}&quot;,
       &quot;format&quot;: {&quot;type&quot;: &quot;json&quot;, &quot;property&quot;: &quot;data&quot;},
 |     // Otherwise use the first unnamed argument for source values
       &quot;values&quot;: [ {{{1|
         {&quot;lat&quot;:65.6, &quot;lon&quot;:-168.1, &quot;color&quot;:&quot;#f00&quot;, &quot;size&quot;: 10},
         {&quot;lat&quot;:90, &quot;lon&quot;:-180, &quot;shape&quot;:&quot;cross&quot;, &quot;color&quot;:&quot;#f00&quot;, &quot;size&quot;: 500},
         {&quot;lat&quot;:-90, &quot;lon&quot;:180, &quot;shape&quot;:&quot;cross&quot;, &quot;color&quot;:&quot;#f00&quot;, &quot;size&quot;: 500},
         {&quot;lat&quot;:0, &quot;lon&quot;:-180, &quot;shape&quot;:&quot;cross&quot;, &quot;color&quot;:&quot;#f00&quot;, &quot;size&quot;: 500},
         {&quot;lat&quot;:0, &quot;lon&quot;:180, &quot;shape&quot;:&quot;cross&quot;, &quot;color&quot;:&quot;#f00&quot;, &quot;size&quot;: 500},
         {&quot;lat&quot;:20, &quot;lon&quot;:-120, &quot;color&quot;:&quot;#0f0&quot;},
         {&quot;lat&quot;:40, &quot;lon&quot;:-120, &quot;shape&quot;:&quot;diamond&quot;, &quot;color&quot;:&quot;#0f0&quot;, &quot;size&quot;: 80, &quot;text&quot;: &quot;Some cool text&quot;, &quot;textColor&quot;: &quot;#0ff&quot;, &quot;textFontSize&quot;: 20, &quot;textBaseline&quot;: &quot;middle&quot;},
         {&quot;lat&quot;:-10, &quot;lon&quot;:20, &quot;img&quot;:&quot;Volcano red 32x32.svg&quot;, &quot;offsetY&quot;:-10},
         {&quot;lat&quot;:0, &quot;lon&quot;:0, &quot;img&quot;:&quot;Volcano red 32x32.svg&quot;, &quot;width&quot;:25, &quot;height&quot;: 25, &quot;offsetY&quot;:-10, &quot;text&quot;: &quot;Big volcano&quot;, &quot;textFontWeight&quot;: &quot;bold&quot;, &quot;textFontSize&quot;: 20, &quot;textColor&quot;: &quot;#fff&quot;},
         {&quot;lat&quot;:37.774755, &quot;lon&quot;:-122.454688, &quot;color&quot;:&quot;#f00&quot;, &quot;size&quot;: 10},
         }}}
       ],
 }}}}
       &quot;transform&quot;: [
 {{#if:{{{wdqs|}}} |
         // If query is given, translate geo coordinate [longitude, latitude] array into two values
         { &quot;type&quot;: &quot;formula&quot;, &quot;field&quot;:&quot;lon&quot;, &quot;expr&quot;: &quot;datum.coord[0]&quot; },
         { &quot;type&quot;: &quot;formula&quot;, &quot;field&quot;:&quot;lat&quot;, &quot;expr&quot;: &quot;datum.coord[1]&quot; },
 }}
         {
           &quot;type&quot;: &quot;geo&quot;,
           &quot;projection&quot;: &quot;mercator&quot;,
           &quot;scale&quot;: {&quot;expr&quot;: &quot;imgTileSize/PI/2*pow(2,imgZoom)&quot;},
           &quot;translate&quot;: [{&quot;expr&quot;: &quot;imgXC&quot;}, {&quot;expr&quot;: &quot;imgYC&quot;}],
           &quot;center&quot;: [{&quot;expr&quot;: &quot;imgLon&quot;}, {&quot;expr&quot;: &quot;imgLat&quot;}],
           &quot;lon&quot;: &quot;lon&quot;, &quot;lat&quot;: &quot;lat&quot;
         },
         { &quot;type&quot;: &quot;formula&quot;, &quot;field&quot;:&quot;layout_x&quot;, &quot;expr&quot;: &quot;datum.layout_x + (datum.offsetX {{!}}{{!}} 0)&quot; },
         { &quot;type&quot;: &quot;formula&quot;, &quot;field&quot;:&quot;layout_y&quot;, &quot;expr&quot;: &quot;datum.layout_y + (datum.offsetY {{!}}{{!}} 0)&quot; },
         { &quot;type&quot;: &quot;formula&quot;, &quot;field&quot;:&quot;color&quot;, &quot;expr&quot;: &quot;datum.color {{!}}{{!}} '#c33'&quot; },
         { &quot;type&quot;: &quot;formula&quot;, &quot;field&quot;:&quot;textColor&quot;, &quot;expr&quot;: &quot;datum.textColor {{!}}{{!}} datum.color&quot; },
         { &quot;type&quot;: &quot;formula&quot;, &quot;field&quot;:&quot;strokeColor&quot;, &quot;expr&quot;: &quot;datum.strokeColor {{!}}{{!}} '#ffe7e6'&quot; }
       ]
     },
     {
       // Hack: single value data source for drawing/hiding images and other non-series elements
       &quot;name&quot;: &quot;dummyData&quot;,
       &quot;values&quot;: [{}]
     }
   ],
 {{#if:{{{colorScaleField|}}}|
   &quot;scales&quot;: [
     {
       &quot;name&quot;: &quot;sColor&quot;,
       &quot;type&quot;: &quot;ordinal&quot;,
       &quot;range&quot;: &quot;category10&quot;,
       &quot;domain&quot;: {&quot;data&quot;: &quot;data&quot;, &quot;field&quot;: &quot;{{{colorScaleField|}}}&quot;}
     },
   ],
 }}
 // Legend only works if showLegend and colorScaleField are set
 {{#if:{{{showLegend|}}}|
   &quot;legends&quot;: [
     {
       &quot;title&quot;: &quot;Legend&quot;,
       &quot;fill&quot;: &quot;sColor&quot;,
       &quot;properties&quot;: {
        &quot;legend&quot;: {
          &quot;x&quot;: {&quot;value&quot;: {{#expr: {{{width|400}}} - {{{legendWidth|100}}} }} },
          &quot;width&quot;: {&quot;value&quot;: {{{legendWidth|100}}} },
          &quot;stroke&quot;: {&quot;value&quot;: &quot;#ddd&quot;},
          &quot;fill&quot;: {&quot;value&quot;: &quot;#fff&quot;},
          &quot;strokeWidth&quot;: {&quot;value&quot;: 2}
        }
       }
     }
   ],
 }}
   &quot;marks&quot;: [
     {
       &quot;type&quot;: &quot;image&quot;,
       &quot;from&quot;: {
         &quot;data&quot;: &quot;dummyData&quot;,
         &quot;transform&quot;: [
           { &quot;type&quot;: &quot;formula&quot;, &quot;field&quot;:&quot;url&quot;, &quot;expr&quot;: &quot;'mapsnapshot:///?width='+imgWidth+'&amp;height='+imgHeight+'&amp;zoom='+imgZoom+'&amp;lat='+imgLat+'&amp;lon='+imgLon{{#if:{{{style|}}}|+'&amp;style={{{style}}}'}}&quot; }
         ]
       },
       &quot;properties&quot;: {
         &quot;enter&quot;: {
           &quot;url&quot;: {&quot;field&quot;: &quot;url&quot;},
           &quot;xc&quot;: {&quot;signal&quot;: &quot;imgXC&quot;}, &quot;yc&quot;: {&quot;signal&quot;: &quot;imgYC&quot;},
           &quot;width&quot;: {&quot;signal&quot;: &quot;imgWidth&quot;}, &quot;height&quot;: {&quot;signal&quot;: &quot;imgHeight&quot;}
         }
       }
     },
     {
       // Places an image of a given name and size at the [lan,lon] location
       &quot;type&quot;: &quot;image&quot;,
       &quot;from&quot;: {
         &quot;data&quot;: &quot;data&quot;,
         &quot;transform&quot;: [
           { &quot;type&quot;: &quot;filter&quot;, &quot;test&quot;: &quot;datum.img&quot; },
           { &quot;type&quot;: &quot;formula&quot;, &quot;field&quot;:&quot;iconWidth&quot;, &quot;expr&quot;: &quot;datum.width {{!}}{{!}} 0&quot; },
           { &quot;type&quot;: &quot;formula&quot;, &quot;field&quot;:&quot;iconHeight&quot;, &quot;expr&quot;: &quot;datum.height {{!}}{{!}} 0&quot; },
           { &quot;type&quot;: &quot;formula&quot;, &quot;field&quot;:&quot;img&quot;,
             &quot;expr&quot;: &quot;if(!test(/^[a-z]+:\\/\\//, datum.img), 'wikifile:///'+datum.img, datum.img)&quot; },
           // Ensure that either width or height parameter is passed to wikifile:// request
           { &quot;type&quot;: &quot;formula&quot;, &quot;field&quot;:&quot;img&quot;,
             &quot;expr&quot;: &quot;if((datum.iconWidth {{!}}{{!}} datum.iconHeight) &amp;&amp; !test(/[?&amp;](width{{!}}height)=\\d/, datum.img),if(datum.iconWidth,datum.img+'?width='+datum.iconWidth,datum.img+'?height='+datum.iconHeight), datum.img)&quot; }
       ]},
       &quot;properties&quot;: {
         &quot;enter&quot;: {
           &quot;url&quot;: {&quot;field&quot;: &quot;img&quot;},
           &quot;xc&quot;: {&quot;field&quot;: &quot;layout_x&quot;}, &quot;yc&quot;: {&quot;field&quot;: &quot;layout_y&quot;},
           &quot;width&quot;: {&quot;field&quot;: &quot;iconWidth&quot;}, &quot;height&quot;: {&quot;field&quot;: &quot;iconHeight&quot;}
         }
       }
     },
     {
       // Draw marks of a given color, shape, and size at the [lan,lon] location
       &quot;type&quot;: &quot;symbol&quot;,
       &quot;from&quot;: {
         &quot;data&quot;: &quot;data&quot;,
         &quot;transform&quot;: [{ &quot;type&quot;: &quot;filter&quot;, &quot;test&quot;: &quot;!datum.img&quot; }]
       },
       &quot;properties&quot;: {
         &quot;enter&quot;: {
           &quot;x&quot;: {&quot;field&quot;: &quot;layout_x&quot;},
           &quot;y&quot;: {&quot;field&quot;: &quot;layout_y&quot;},
           // If colorScaleField is set, use color scaling, otherwise use the preset color value
           &quot;fill&quot;: { {{#if:{{{colorScaleField|}}}| &quot;field&quot;: &quot;type&quot;, &quot;scale&quot;: &quot;sColor&quot; | &quot;field&quot;: &quot;color&quot; }} },
           &quot;size&quot;: {&quot;field&quot;: &quot;size&quot;},
           &quot;shape&quot;: {&quot;field&quot;: &quot;shape&quot;},
           &quot;stroke&quot;: {&quot;field&quot;: &quot;strokeColor&quot;}
         }
       }
     },
     {
       // Draw text with the given color and size at the [lan,lon] location
       // See https://github.com/vega/vega/wiki/Marks#text for all parameter description (prepend &quot;text&quot; and capitalize them)
       &quot;type&quot;: &quot;text&quot;,
       &quot;from&quot;: {
         &quot;data&quot;: &quot;data&quot;,
         &quot;transform&quot;: [
           { &quot;type&quot;: &quot;filter&quot;, &quot;test&quot;: &quot;datum.text&quot; },
           // Figure out if this is an LTR or RTL page. For LTR, show label to the right of the icon, left-aligned. For RTL, reverse.
           { &quot;type&quot;: &quot;formula&quot;, &quot;field&quot;:&quot;isLTR&quot;, &quot;expr&quot;: &quot;'{{DIRECTIONMARK}}' == '\\u200E'&quot; },
           // If these values are not defined (&quot;undefined&quot; is not allowed, so test for truthiness and not 0)
           { &quot;type&quot;: &quot;formula&quot;, &quot;field&quot;:&quot;textDx&quot;, &quot;expr&quot;: &quot;if(!datum.textDx &amp;&amp; datum.textDx != 0, if(datum.isLTR,8,-8), datum.textDx)&quot; },
           { &quot;type&quot;: &quot;formula&quot;, &quot;field&quot;:&quot;textAlign&quot;, &quot;expr&quot;: &quot;if(!datum.textAlign, if(datum.isLTR,'left','right'), datum.textAlign)&quot; },
           { &quot;type&quot;: &quot;formula&quot;, &quot;field&quot;:&quot;textBaseline&quot;, &quot;expr&quot;: &quot;datum.textBaseline {{!}}{{!}} 'middle'&quot; }
       ]},
       &quot;properties&quot;: {
         &quot;enter&quot;: {
           &quot;text&quot;: {&quot;field&quot;: &quot;text&quot;},
           &quot;x&quot;: {&quot;field&quot;: &quot;layout_x&quot; },
           &quot;y&quot;: {&quot;field&quot;: &quot;layout_y&quot;},
           &quot;dx&quot;: {&quot;field&quot;: &quot;textDx&quot; },
           &quot;dy&quot;: {&quot;field&quot;: &quot;textDy&quot;},
           &quot;fill&quot;: {&quot;field&quot;: &quot;textColor&quot;},
           &quot;align&quot;: {&quot;field&quot;: &quot;textAlign&quot;},
           &quot;baseline&quot;: {&quot;field&quot;: &quot;textBaseline&quot;},
           &quot;radius&quot;: {&quot;field&quot;: &quot;textRadius&quot;},
           &quot;theta&quot;: {&quot;field&quot;: &quot;textTheta&quot;},
           &quot;angle&quot;: {&quot;field&quot;: &quot;textAngle&quot;},
           &quot;font&quot;: {&quot;field&quot;: &quot;textFont&quot;},
           &quot;fontSize&quot;: {&quot;field&quot;: &quot;textFontSize&quot;},
           &quot;fontWeight&quot;: {&quot;field&quot;: &quot;textFontWeight&quot;},
           &quot;fontStyle&quot;: {&quot;field&quot;: &quot;textFontStyle&quot;}
         }
       }
     },
     {
       // Draw a low-zoom locator map frame
       &quot;type&quot;: &quot;rect&quot;,
       &quot;from&quot;: {
         &quot;data&quot;: &quot;dummyData&quot;,
         &quot;transform&quot;: [
           { &quot;type&quot;: &quot;filter&quot;, &quot;test&quot;: &quot;showMiniMap&quot; }
         ]
       },
       &quot;properties&quot;: {
         &quot;enter&quot;: {
           &quot;xc&quot;: {&quot;signal&quot;: &quot;picXC&quot;}, &quot;yc&quot;: {&quot;signal&quot;: &quot;picYC&quot;},
           &quot;width&quot;: {&quot;signal&quot;: &quot;picWidth&quot;, &quot;offset&quot;:2}, &quot;height&quot;: {&quot;signal&quot;: &quot;picHeight&quot;},
           &quot;stroke&quot;: {&quot;value&quot;:&quot;#fff&quot;},&quot;strokeWidth&quot;: {&quot;value&quot;:6}
         }
       }
     },
     {
       // Draw a low-zoom locator map by using a premade world map image
       &quot;type&quot;: &quot;image&quot;,
       &quot;from&quot;: {
         &quot;data&quot;: &quot;dummyData&quot;,
         &quot;transform&quot;: [
           { &quot;type&quot;: &quot;filter&quot;, &quot;test&quot;: &quot;showMiniMap&quot; },
           { &quot;type&quot;: &quot;formula&quot;, &quot;field&quot;:&quot;url&quot;, &quot;expr&quot;: &quot;1&quot; }
         ]
       },
       &quot;properties&quot;: {
         &quot;enter&quot;: {
           &quot;url&quot;: {&quot;value&quot;: &quot;wikirawupload:{{filepath:Earthmap1000x500.jpg|180}}&quot;},
           &quot;xc&quot;: {&quot;signal&quot;: &quot;picXC&quot;}, &quot;yc&quot;: {&quot;signal&quot;: &quot;picYC&quot;},
           &quot;width&quot;: {&quot;signal&quot;: &quot;picWidth&quot;}, &quot;height&quot;: {&quot;signal&quot;: &quot;picHeight&quot;}
         }
       }
     },
     {
       // Draw a zoom-out mark at the [lan,lon] location
       &quot;type&quot;: &quot;symbol&quot;,
       &quot;from&quot;: {
         &quot;data&quot;: &quot;dummyData&quot;,
         &quot;transform&quot;: [
           { &quot;type&quot;: &quot;filter&quot;, &quot;test&quot;: &quot;showMiniMap&quot; },
           { &quot;type&quot;: &quot;formula&quot;, &quot;field&quot;:&quot;lat&quot;, &quot;expr&quot;: &quot;imgLat&quot; },
           { &quot;type&quot;: &quot;formula&quot;, &quot;field&quot;:&quot;lon&quot;, &quot;expr&quot;: &quot;imgLon&quot; },
           {
             &quot;type&quot;: &quot;geo&quot;,
             &quot;projection&quot;: &quot;equirectangular&quot;,
             &quot;scale&quot;: {&quot;expr&quot;: &quot;180/2/PI&quot;},
             &quot;translate&quot;: [{&quot;expr&quot;: &quot;picXC&quot;}, {&quot;expr&quot;: &quot;picYC&quot;}],
             &quot;center&quot;: [{&quot;expr&quot;: &quot;0&quot;}, {&quot;expr&quot;: &quot;0&quot;}],
             &quot;lon&quot;: &quot;lon&quot;, &quot;lat&quot;: &quot;lat&quot;
           }
         ]
       },
       &quot;properties&quot;: {
         &quot;enter&quot;: {
           &quot;x&quot;: {&quot;field&quot;: &quot;layout_x&quot;}, &quot;y&quot;: {&quot;field&quot;: &quot;layout_y&quot;},
           &quot;fill&quot;: {&quot;value&quot;: &quot;#c33&quot;},
           &quot;stroke&quot;: {&quot;value&quot;: &quot;#ffe7e6&quot;},
           &quot;size&quot;: {&quot;value&quot;: 40}
         }
       }
     }
   ]
 }
 }}
 {{#if:{{{wdqs|}}}|
 &lt;small&gt;{{#invoke:TNT|msg|Original/Template:Graphs.tab|source-wdqs|https://query.wikidata.org/#{{urlencode:{{{table}}}|PATH}}}}.&lt;/small&gt;
 |{{#if:{{{table|}}}|
 &lt;small&gt;{{#invoke:TNT|msg|Original/Template:Graphs.tab|source-table|{{#invoke:TNT|link|{{{table}}}}}}}.&lt;/small&gt;
 }}}}&lt;/includeonly&gt;&lt;noinclude&gt;
 {{documentation}}