Jump to content

Maps in Mediawiki: Difference between revisions

From Squirrel's Lair
Ttenbergen (talk | contribs)
Ttenbergen (talk | contribs)
Line 59: Line 59:
}} -->
}} -->


== Encode locations ==
== Encode locations in a cargo table to use them in queries==
[[Template:Place]] defines [https://wiki.squirrelslair.ca/index.php?title=Special:CargoTables/Place Cargo Table Place].  
[[Template:Place]] defines [https://wiki.squirrelslair.ca/index.php?title=Special:CargoTables/Place Cargo Table Place].  


Line 67: Line 67:
{{Place|
{{Place|
| Name=North Forge
| Name=North Forge
| Description=A place entry for testing
| Description=[https://northforge.ca/ A makerspace]
| Coordinates = 49.89959808249238, -97.14224677575343
| Coordinates = 49.89959808249238, -97.14224677575343
}}
}}
{{Place|
{{Place|
| Name=WRC
| Name=WRC
| Description=A place entry for testing
| Description=[https://winnipegrowingclub.ca/ A rowing club]
| Coordinates = 49.88086121609553, -97.13063599481808
| Coordinates = 49.88086121609553, -97.13063599481808
}}
}}

Revision as of 21:41, 2022 November 11

This page is a test ground and demo for using maps in mediawiki.

Maps extension

Maps extension with an inline Cargo query to set targets and a line

{{#display_map:

{{#cargo_query: table=Place
|fields   = CONCAT(Coordinates__full, '~', Name , '~',Description )
|format=list
|delimiter=;
|no html
}}

|lines= {{#cargo_query: table=Place

|fields   = Coordinates__full

|where=Name="North Forge"

|format=list
|delimiter=;
|no html
}}:{{#cargo_query: table=Place
|fields   = Coordinates__full

|where=Name="WRC"

|format=list
|delimiter=;
|no html
}}
 |copycoords=yes
 |resizable=on
 |layers=OpenStreetMap,Esri.WorldImagery 

}}

Cargo Displayformat Maps

Cargo Displayformat Maps

{{#cargo_query: table=Place |format = openlayers |fields = Name, Description, Coordinates |width = 400 |height = 300 }}

{{#cargo_query: table=Place |format = leaflet |fields = Name, Description, Coordinates |width = 400 |height = 300 }}

Notes

  • parameters:
    • |icon = Squirrelslair 200.png - works, but poor visibility
  • googlemaps would require billing

Encode locations in a cargo table to use them in queries

Template:Place defines Cargo Table Place.

Locations can be grabbed from Google Maps by right-clicking on an area and then clicking on the coordinates. They can be pasted into the Coordinates template paramater.

Here are the template calls (see edit view).


  • Cargo

{{#cargo_store: _table = Place | Name= North Forge | Description= A makerspace | Coordinates = 49.89959808249238, -97.14224677575343 }}


  • Cargo

{{#cargo_store: _table = Place | Name= WRC | Description= A rowing club | Coordinates = 49.88086121609553, -97.13063599481808 }}