开发者 |
Fullworks
fullworks alanfuller |
---|---|
更新时间 | 2023年2月7日 19:42 |
WordPress版本: | 6.0 |
版权: | GPLv3 or later |
版权网址: | 版权信息 |
Unlike Google Maps, you do not need to lodge a credit card to get and API key. You still need to getan APIkey and MapQuest does have limits, which you will have to pay for if you exceed them, but you are unlikely too unless you have a missively popular site, even then the costs are cheaper than Google.
Create a free account on MapQuest (https://developer.mapquest.com/)[https://developer.mapquest.com/plan_purchase/steps/business_edition/business_edition_free/register] Login and go to (Add API Key)[https://developer.mapquest.com/user/118761/apps/add] you just need a name, don't worry about Callback URL it is not used bythis plugin
to display a map on the page use the short code
[get-directions] with the appropriate parameters
A destination is mandatory and is set as a latitude / longitude pair
e.g. [get-directions latlng="51.36887,-0.408999"]
Optional
A route selection dialogue overlay will be shown, unless you turn it off with
showroute="false"
Specify the map image height ( default = 500px)
height="400px"
Specify the map width ( default full width - 100%)
width="66%"
you can use px too e.g. 320px but bear in mind fixed sizes on responsive sites
Specify the initial zoom level (1-16) (default 12)
zoom="10"
:note the map will auto zoom if a route is displayed so this setting is only really relevant when hideroute='yes'
Specify the type of map controls
controls="true"
shows multi controls
controls="false"
shows only zoom controls
Specify the language for the directions ( note mapquest only translates the route directions, some text remains in English )
locale="en_US"
shows in Amercican English ( default )
locale="fr_FR"
shows in Frenchlocale="hu_HU"
shows in Hungarianlocale="es_ES"
shows in Spanish
many locale codes are supported, try them out, if it doesn't work you just get "Sorry e could not calculate directions ..." when you test directions. If you need further info on loacles contact mapquest.
Specify the units used in the directions
unit="m"
shows distances in miles ( default )
unit="k"
shows distances in kilometers ( default )
Examples[get-directions latlng="40.748021,-73.98512" controls="false"]
You can display one shortcode and as many widgets as you like on one page. Multiple shortcodes on one page is a Pro feature.
Multiple map marker is only available in the Pro version