PayPal-donate (Wiki).png
O ile nie zaznaczono inaczej, prawa autorskie zamieszczonych materiałów należą do Jana Woreczko & Wadi.

(Unless otherwise stated, the copyright of the materials included belong to Jan Woreczko & Wadi.)


Szablon:GEMap/TemplateDoc

Z Wiki.Meteoritica.pl

(Różnice między wersjami)
(Extension options)
m (Aplet Extension:Google Maps)
 
(Nie pokazano 10 wersji pomiędzy niniejszymi.)
Linia 1: Linia 1:
-
== Aplet GoogleMaps ==
+
<span style="color:{{Color wiki-red}}">'''Powyższy aplet przestał działać w październiku 2018 roku.''' Firma Google wprowadziła nową wersję Google Maps JavaScript API v3, wcześniejsza v2 przestała działać! Wprowadzono również opłatę za korzystanie z nowego apletu, więc stworzyliśmy tymczasowo nowy szablon '''<nowiki>{{GEMap-MyWiki}}</nowiki>''', który pozwala wyświetlać mapy Google na portalu.</span>
 +
 
 +
Więcej szczegółów w opisie szablonu → '''[[Szablon:GEMap-MyWiki|Szablon:GEMap-MyWiki]]'''.
 +
 
 +
:<span style="color:{{Color wiki-red}}"><nowiki>*</nowiki> W listopadzie 2013 roku firma Google zmieniła zasady obsługi apletu (Google Maps JavaScript API v2) odpowiedzialnego za wyświetlanie map na stronach innych użytkowników. Skrypty i&nbsp;parametry rozszerzenia Mediawiki: [http://www.mediawiki.org/wiki/Extension:Google_Maps Extension:Google Maps], sterujące wyświetlaniem mapy w&nbsp;nowej wersji apletu Google są ignorowane lub nie działają poprawnie. Jak przystało na monopolistę, firma Google nie poczuwała się do zachowania kompatybilności w dół.</span>
 +
 
 +
:W związku z tym, do czasu zaimplementowania nowego apletu ([http://www.mediawiki.org/wiki/Extension:Maps Extension:Maps]), mapy na portalu {{SITENAME}} nie wyświetlają się zgodnie z&nbsp;intencjami [[Redakcja|autorów]]. Przepraszamy.
 +
 
 +
<br clear="all"/>
 +
 
 +
== Aplet '''Extension:Maps''' ==
 +
 
 +
Nowy aplet wyświetlający mapy Google: http://www.mediawiki.org/wiki/Extension:Maps, nie jest jeszcze zaimplementowany na {{SITENAME}}
 +
 
 +
== Aplet '''Extension:Google Maps''' ==
Applet: http://www.mediawiki.org/wiki/Extension:Google_Maps  
Applet: http://www.mediawiki.org/wiki/Extension:Google_Maps  
Linia 5: Linia 19:
Opis składni: http://www.mediawiki.org/wiki/Extension:Google_Maps/Syntax
Opis składni: http://www.mediawiki.org/wiki/Extension:Google_Maps/Syntax
-
== Extension options ==
+
=== Extension options ===
<pre>
<pre>
{{GEMap
{{GEMap
 +
| htmlFileMap = /* patrz → [[Szablon:GEMap-MyWiki]] */
| kml1 =  
| kml1 =  
| kml2 =  
| kml2 =  
Linia 17: Linia 32:
| lon = {{{lon|20.00}}}
| lon = {{{lon|20.00}}}
| zoom = {{{zoom|5}}}
| zoom = {{{zoom|5}}}
-
| width = {{{width|400}}}
+
| width = {{{width| {{GEFrame-dfltWidth}} }}}
-
| height = {{{height|300}}}
+
| height = {{{height| {{GEFrame-dfltHeight}} }}}
| type = {{{type|terrain}}}
| type = {{{type|terrain}}}
| controls = {{{controls|medium}}}
| controls = {{{controls|medium}}}
Linia 29: Linia 44:
Available coding options are:
Available coding options are:
-
* width (in pixels; default is 740)
+
* '''htmlFileMap; patrz → [[Szablon:GEMap-MyWiki]]'''
-
* height (in pixels; default is 600)
+
<pre>{{ #if: {{{htmlFileMap|}}}
-
* lat (the center latitude on the map)
+
| {{GEMap-MyWiki |htmlFileMap={{{htmlFileMap}}} |width={{{width|{{GEFrame-dfltWidth}} }}} |height={{{height|{{GEFrame-dfltHeight}} }}}}}
-
* lon (the center longitude on the map)
+
| <div class="GooglePlaceMap">
-
* zoom (the zoom level; 0 is the furthest away, 21 is the closest in)
+
{{#tag:googlemap
-
* type ("normal" or "map", "hybrid", or "satellite"; default is "hybrid")
+
| ...
-
* controls (''small'' creates +/- zoom buttons, ''medium'' has zoom buttons and pan buttons, ''large'' has pan buttons with a sliding scale for zoom, and ''none'' has no buttons)
+
}}</div>
 +
}}
 +
</pre>
 +
* width (in pixels; default is <nowiki>{{GEFrame-dfltWidth}}</nowiki> = {{GEFrame-dfltWidth}})
 +
* height (in pixels; default is <nowiki>{{GEFrame-dfltHeight}}</nowiki> = {{GEFrame-dfltHeight}})
 +
* lat (the center latitude on the map; default is 52.00)
 +
* lon (the center longitude on the map; default is 20.00)
 +
* zoom (the zoom level; 0 is the furthest away, 21 is the closest in; default is 5)
 +
* type ("normal" or "map" or "'''roadmap'''", "'''hybrid'''", or "'''satellite'''"; default is "hybrid"; default is "'''terrain'''")
 +
* controls (''small'' creates +/- zoom buttons, ''medium'' has zoom buttons and pan buttons, ''large'' has pan buttons with a sliding scale for zoom, and ''none'' has no buttons; default is "medium")
* selector (show the map/hybrid/satellite selector? ''yes'' (default) and ''no''.)
* selector (show the map/hybrid/satellite selector? ''yes'' (default) and ''no''.)
* scale (show the distance scale? ''yes'' and ''no'' (default).)
* scale (show the distance scale? ''yes'' and ''no'' (default).)
Linia 48: Linia 72:
<pre>
<pre>
-
<googlemap lat="52.523777" lon="13.411896" zoom="12" width="500" height="400" type="map" controls="small">
+
<googlemap lat="52.523777" lon="13.411896"  
 +
zoom="12" width="500" height="400" type="hybrid"  
 +
controls="small">
52.499683,13.333907,Kaiser Wilhelm Memorial Church
52.499683,13.333907,Kaiser Wilhelm Memorial Church
52.510019,13.369893,Berlin Philharmonie
52.510019,13.369893,Berlin Philharmonie
Linia 54: Linia 80:
</pre>
</pre>
-
== Using <nowiki><googlemap></nowiki> in a template ==
+
=== Using <nowiki><googlemap></nowiki> in a template ===
If you would like to put a map inside a template, then you will need to use a slightly different coding to get the coding to work properly.
If you would like to put a map inside a template, then you will need to use a slightly different coding to get the coding to work properly.
Linia 70: Linia 96:
The following is an example for including a map ''with'' markers.
The following is an example for including a map ''with'' markers.
<pre>
<pre>
-
<nowiki>
+
<nowiki>{{#tag:googlemap
-
{{#tag:googlemap
+
|#770077  
|#770077  
{{{Markers}}}
{{{Markers}}}
Linia 77: Linia 102:
|lat={{{1}}}  
|lat={{{1}}}  
|lon={{{2}}}
|lon={{{2}}}
-
}}
+
}}</nowiki>
-
</nowiki>
+
</pre>
</pre>
Linia 84: Linia 108:
if the above does not work, try
if the above does not work, try
-
<pre>
+
<pre><nowiki>
-
<nowiki>
+
{{#tag:googlemap
{{#tag:googlemap
|lat={{{1}}}
|lat={{{1}}}
Linia 92: Linia 115:
</pre>
</pre>
-
== Przykładowa mapa ==
+
=== Przykładowa mapa ===
<div style="float:left; margin-right:24px">
<div style="float:left; margin-right:24px">
Linia 107: Linia 130:
<pre>
<pre>
-
<googlemap lat="42.717255" lon="-73.20714" zoom="14" width="400" height="300" controls="medium">
+
<googlemap lat="42.717255" lon="-73.20714"  
-
42.711658, -73.20538, Red maple in front of the chem/computer science building
+
zoom="14" width="400" height="300"  
 +
controls="medium">
 +
42.711658, -73.20538, Red maple in front
 +
  of the chem/computer science building
42.712225, -73.205305, Sugar maple in front of West
42.712225, -73.205305, Sugar maple in front of West
#82C575
#82C575
Linia 119: Linia 145:
<br clear="all"/>
<br clear="all"/>
 +
 +
== Zobacz również ==
 +
 +
* [[Szablon:GEMap-MyWiki]]

Aktualna wersja na dzień 16:36, 23 paź 2018

Powyższy aplet przestał działać w październiku 2018 roku. Firma Google wprowadziła nową wersję Google Maps JavaScript API v3, wcześniejsza v2 przestała działać! Wprowadzono również opłatę za korzystanie z nowego apletu, więc stworzyliśmy tymczasowo nowy szablon {{GEMap-MyWiki}}, który pozwala wyświetlać mapy Google na portalu.

Więcej szczegółów w opisie szablonu → Szablon:GEMap-MyWiki.

* W listopadzie 2013 roku firma Google zmieniła zasady obsługi apletu (Google Maps JavaScript API v2) odpowiedzialnego za wyświetlanie map na stronach innych użytkowników. Skrypty i parametry rozszerzenia Mediawiki: Extension:Google Maps, sterujące wyświetlaniem mapy w nowej wersji apletu Google są ignorowane lub nie działają poprawnie. Jak przystało na monopolistę, firma Google nie poczuwała się do zachowania kompatybilności w dół.
W związku z tym, do czasu zaimplementowania nowego apletu (Extension:Maps), mapy na portalu Wiki.Meteoritica.pl nie wyświetlają się zgodnie z intencjami autorów. Przepraszamy.


Spis treści

Aplet Extension:Maps

Nowy aplet wyświetlający mapy Google: http://www.mediawiki.org/wiki/Extension:Maps, nie jest jeszcze zaimplementowany na Wiki.Meteoritica.pl

Aplet Extension:Google Maps

Applet: http://www.mediawiki.org/wiki/Extension:Google_Maps

Opis składni: http://www.mediawiki.org/wiki/Extension:Google_Maps/Syntax

Extension options

{{GEMap
| htmlFileMap = /* patrz → [[Szablon:GEMap-MyWiki]] */
| kml1 = 
| kml2 = 
...
| kml29 = 
| kml30 = 
| lat = {{{lat|52.00}}}
| lon = {{{lon|20.00}}}
| zoom = {{{zoom|5}}}
| width = {{{width| {{GEFrame-dfltWidth}} }}}
| height = {{{height| {{GEFrame-dfltHeight}} }}}
| type = {{{type|terrain}}}
| controls = {{{controls|medium}}}
| scale = {{{scale|yes}}}
| units = {{{units|meters}}}
| selector = {{{selector|yes}}}
}}

Available coding options are:

{{ #if: {{{htmlFileMap|}}} 
| {{GEMap-MyWiki |htmlFileMap={{{htmlFileMap}}} |width={{{width|{{GEFrame-dfltWidth}} }}} |height={{{height|{{GEFrame-dfltHeight}} }}}}} 
| <div class="GooglePlaceMap">
{{#tag:googlemap
| ...
}}</div>
}}
  • width (in pixels; default is {{GEFrame-dfltWidth}} = 450)
  • height (in pixels; default is {{GEFrame-dfltHeight}} = 360)
  • lat (the center latitude on the map; default is 52.00)
  • lon (the center longitude on the map; default is 20.00)
  • zoom (the zoom level; 0 is the furthest away, 21 is the closest in; default is 5)
  • type ("normal" or "map" or "roadmap", "hybrid", or "satellite"; default is "hybrid"; default is "terrain")
  • controls (small creates +/- zoom buttons, medium has zoom buttons and pan buttons, large has pan buttons with a sliding scale for zoom, and none has no buttons; default is "medium")
  • selector (show the map/hybrid/satellite selector? yes (default) and no.)
  • scale (show the distance scale? yes and no (default).)
  • overview (show the inset navigation map? yes and no (default).)
  • icons (web address if the marker icon is customized. With "{label}" where the name of the icon will be inserted; defaults to "http://maps.google.com/mapfiles/marker{label}.png")
  • icon (web address if the marker icon is not specified; the default icon is http://maps.google.com/mapfiles/marker.png)
  • units ("meters" or "miles"; default is "meters".)

All attributes are optional.

So the final code might be:

<googlemap lat="52.523777" lon="13.411896" 
zoom="12" width="500" height="400" type="hybrid" 
controls="small">
52.499683,13.333907,Kaiser Wilhelm Memorial Church
52.510019,13.369893,Berlin Philharmonie
</googlemap>

Using <googlemap> in a template

If you would like to put a map inside a template, then you will need to use a slightly different coding to get the coding to work properly.

The following is an example for including a map without markers.

BAD:

<googlemap lat="{{{1}}}" lon="{{{2}}}">

GOOD:

{{#tag:googlemap|lat={{{1}}} lon={{{2}}}}}

The following is an example for including a map with markers.

{{#tag:googlemap
|#770077 
{{{Markers}}}
|zoom=5
|lat={{{1}}} 
|lon={{{2}}}
}}

This #tag technique only works with MediaWiki 1.12 and later.

if the above does not work, try

{{#tag:googlemap
|lat={{{1}}}
|lon={{{2}}}
}}

Przykładowa mapa

<googlemap lat="42.717255" lon="-73.20714" 
zoom="14" width="400" height="300" 
controls="medium">
42.711658, -73.20538, Red maple in front
  of the chem/computer science building
42.712225, -73.205305, Sugar maple in front of West
#82C575
42.709876, -73.211946
42.71612, -73.208342
42.718201, -73.217869
42.720155, -73.204908
</googlemap>


Zobacz również

Osobiste