Help:Page forms: Difference between revisions

Jump to navigation Jump to search
Line 330: Line 330:
{{anchor|googlemaps|leaflet|openlayers}}
{{anchor|googlemaps|leaflet|openlayers}}
===googlemaps, leaflet, openlayers===
===googlemaps, leaflet, openlayers===
The "googlemaps</>", "leaflet</>" and "< name=3>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.
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:




<!--T:140-->
 
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>
| <!--T:141--> 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.
| 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.
|}
|}


<!--T:142--> All of the map inputs lets you enter an address to locate the coordinates more easily.
All of the map inputs lets you enter an address to locate the coordinates more easily.
<!--T:143--> 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.
 
<!--T:144--> 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.
<!--T:145--> You can do that using the "feeds to map=" parameter - look for "feeds to map" [[Extension:Page_Forms/Defining_forms#.27field.27_tag</>|here]].
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.


<!--T:146--> All of these formats, by default, rely on external JavaScript code.
You can do that using the "feeds to map=" parameter - look for "feeds to map" [[Extension:Page_Forms/Defining_forms#.27field.27_tag</>|here]].
<!--T:148--> However, you can have the "openlayers" format use local JavaScript code instead, by just installing the [[Special:MyLanguage/Extension:OpenLayers</>|OpenLayers]] extension.


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-->


Navigation menu