Bureaucrats, Moderators (CommentStreams), Interface administrators, Push subscription managers, Suppressors, Administrators
4,206
edits
(→tokens) |
|||
Line 330: | Line 330: | ||
{{anchor|googlemaps|leaflet|openlayers}} | {{anchor|googlemaps|leaflet|openlayers}} | ||
===googlemaps, leaflet, openlayers=== | ===googlemaps, leaflet, openlayers=== | ||
The "googlemaps | The "googlemaps", "leaflet" and "openlayers" input types let you display a map to get a coordinate value, using the < name=4>Google Maps</>, < name=5>Leaflet</> or < name=6>OpenLayers</> services, respectively. | ||
If you are using the "googlemaps" input, you may need to get a [< name=url>https://developers.google.com/maps/</> Google Maps API key], then set it in LocalSettings.php</> via the <code>$wgPageFormsGoogleMapsKey</code></> setting, for the input to display. | If you are using the "googlemaps" input, you may need to get a [< name=url>https://developers.google.com/maps/</> Google Maps API key], then set it in LocalSettings.php</> via the <code>$wgPageFormsGoogleMapsKey</code></> setting, for the input to display. | ||
You can also optionally set these parameters for these input types: | You can also optionally set these parameters for these input types: | ||
{| class="wikitable" | {| class="wikitable" | ||
| <code>height=</code> | | <code>height=</code> | ||
Line 350: | Line 348: | ||
The "leaflet" input type also allows one additional parameter: | The "leaflet" input type also allows one additional parameter: | ||
{| class="wikitable" | {| class="wikitable" | ||
| <code>image=</code> | | <code>image=</code> | ||
| | | sets the specified image (which must be an image that was uploaded to the wiki) as the background for the map, instead of a geographical map. | ||
|} | |} | ||
All of the map inputs lets you enter an address to locate the coordinates more easily. | |||
But if the form already contains one or more fields to enter the address, then the user may have to enter it twice - once to actually store the data, and the second to locate the coordinates. | |||
To avoid users having to do this double work, you can have the address field(s) feed their values directly to the map when locating the point. | |||
You can do that using the "feeds to map=" parameter - look for "feeds to map" [[Extension:Page_Forms/Defining_forms#.27field.27_tag</>|here]]. | |||
All of these formats, by default, rely on external JavaScript code. | |||
However, you can have the "openlayers" format use local JavaScript code instead, by just installing the [[Special:MyLanguage/Extension:OpenLayers</>|OpenLayers]] extension. | |||
====Disabling==== <!--T:147--> | ====Disabling==== <!--T:147--> | ||