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

Z Wiki.Meteoritica.pl

...opis elementów mapy

* W 2018 roku Google zmieniło zasady działania apletu, mapa może wyświetlać się niepoprawnie (pomaga Ctrl+F5); więcej → Szablon:GEMap-MyWiki

* W listopadzie 2013 roku firma Google zmieniła zasady obsługi apletu (Google Maps JavaScript API v3) odpowiedzialnego na wyświetlanie map na stronach innych użytkowników. Skrypty i parametry poprzedniej wersji apletu (Extension:Google Maps) sterujące wyświetlaniem mapy w jego nowej wersji 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.

(i) Dokumentacja (GEMap)


Spis treści

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.


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