Cargo: Difference between revisions

From Maps for MediaWiki
mNo edit summary
mNo edit summary
 
(24 intermediate revisions by the same user not shown)
Line 3: Line 3:
Since version 7.18, Maps integrates with Cargo by makings its map display format more powerful.
Since version 7.18, Maps integrates with Cargo by makings its map display format more powerful.


== Syntax ==


<pre>
{{#cargo_query:tables=Places
| fields=_pageName=Place,PlaceName, Coordinates
| format=map
| icon=Red-marker.png
| scrollzoom=off
}}
</pre>


Cargo query displayed by Maps:
{{#cargo_query:tables=Places
| fields=_pageName=Place,PlaceName, Coordinates
| format=map
| icon=Red-marker.png
| scrollzoom=off
}}
 
For more information, see the Cargo documentation on [https://www.mediawiki.org/wiki/Extension:Cargo/Querying_data querying data].
 
== Parameters ==
 
You can customize the map using the usual customization parameters that Maps supports. See [[customizing Leaflet maps]] and [[customizing Google Maps]] for more details.
 
At present it is only possible to use the default mapping service of your wiki by using <code>format=map</code>. By default this default is Leaflet, but you can [[Installation#Configuration|change the default mapping service]].
 
== Using standard Cargo maps ==
 
While map replaces the standard Cargo display format for <code>format=map</code> with its own maps, you can still use all the standard Cargo display formats. This is done by using the mapping service specific formats such as <code>format=openlayers</code>.
 
'''Cargo query displayed by Maps, using <code>format=map</code>:'''
 
{{#cargo_query:tables=Places
| fields=_pageName=Place,PlaceName, Coordinates
| format=map
| icon=Red-marker.png
| scrollzoom=off
}}
 
'''Cargo query displayed by Cargo, using <code>format=openlayers</code>:'''


{{#cargo_query:tables=Places
{{#cargo_query:tables=Places
|fields=_pageName=Place,PlaceName
| fields=_pageName=Place,PlaceName, Coordinates
|format=map
| format=openlayers
|icon=Red-marker.png
| height=350
}}
}}


Cargo query displayed by Cargo:
'''Cargo query displayed by Cargo, using <code>format=leaflet</code>:'''


{{#cargo_query:tables=Places
{{#cargo_query:tables=Places
|fields=_pageName=Place,PlaceName
| fields=_pageName=Place,PlaceName, Coordinates
|format=openlayers
| format=leaflet
| height=350
| icon=Red-marker.png
}}
}}
 
.
== See also ==
 
* Maps also integrates with [[Semantic MediaWiki]], an alternative to Cargo
* [https://professional.wiki/en/articles/managing-data-in-mediawiki Compare Cargo and Semantic MediaWiki]

Latest revision as of 08:35, 15 May 2020

Cargo is an extension to MediaWiki that lets you store and query data in your wiki.

Since version 7.18, Maps integrates with Cargo by makings its map display format more powerful.

Syntax

{{#cargo_query:tables=Places
| fields=_pageName=Place,PlaceName, Coordinates
| format=map
| icon=Red-marker.png
| scrollzoom=off
}}

{{#cargo_query:tables=Places | fields=_pageName=Place,PlaceName, Coordinates | format=map | icon=Red-marker.png | scrollzoom=off }}

For more information, see the Cargo documentation on querying data.

Parameters

You can customize the map using the usual customization parameters that Maps supports. See customizing Leaflet maps and customizing Google Maps for more details.

At present it is only possible to use the default mapping service of your wiki by using format=map. By default this default is Leaflet, but you can change the default mapping service.

Using standard Cargo maps

While map replaces the standard Cargo display format for format=map with its own maps, you can still use all the standard Cargo display formats. This is done by using the mapping service specific formats such as format=openlayers.

Cargo query displayed by Maps, using format=map:

{{#cargo_query:tables=Places | fields=_pageName=Place,PlaceName, Coordinates | format=map | icon=Red-marker.png | scrollzoom=off }}

Cargo query displayed by Cargo, using format=openlayers:

{{#cargo_query:tables=Places | fields=_pageName=Place,PlaceName, Coordinates | format=openlayers | height=350 }}

Cargo query displayed by Cargo, using format=leaflet:

{{#cargo_query:tables=Places | fields=_pageName=Place,PlaceName, Coordinates | format=leaflet | height=350 | icon=Red-marker.png }}

See also