Menu

Flexible Map

Flexible Map

Easily embed Google Maps in WordPress pages and posts

Attribute reference

Centre and address

Either the center or the address attribute is required. If you provide both, the centre coordinates will be used for the map centre, but directions will use the street address. (This will prevent directions from telling people how to get to the destination opposite yours!)

  1. address

    street address of map centre
    [flexiblemap address="116 Beaumont Street Hamilton NSW Australia"]

  2. center

    coordinates of centre in latitude,longitude
    [flexiblemap center="-34.916721,138.828878"]

  3. description

    a description of the marker location (can have HTML links)
    [flexiblemap center="-34.916721,138.828878" title="Adelaide Hills" description="Lorem ipsum dolor sit amet"]

  4. html

    some simple HTML to add to the info window
    [flexiblemap center="-34.916721,138.828878" title="Adelaide Hills" html="<img src='http://example.com/logo.img' />"]

  5. icon

    URL to icon for the marker
    [flexiblemap center="-34.916721,138.828878" icon="http://maps.google.com/mapfiles/kml/pal3/icon29.png"]

  6. linktarget

    where marker links open, e.g. in a new tab/window.
    [flexiblemap center="-34.916721,138.828878" title="Adelaide Hills" link="http://example.com/" linktarget="_blank"]

  7. linktext

    marker link text, overriding the default text
    [flexiblemap center="-34.916721,138.828878" title="Adelaide Hills" link="http://example.com/" linktext="Read more"]

  8. marker

    coordinates of the marker if different from the centre, in latitude,longitude
    [flexiblemap center="-32.914,151.75" marker="-34.916721,138.828878"]

  9. markeranimation

    set how a single marker is added to the map, from [drop, bounce, none]; default=drop
    [flexiblemap center="-34.916721,138.828878" markeranimation="none"]

  10. showinfo

    show the marker’s info window when the map loads, from [true, false], e.g. showinfo=”false”; default=true
    [flexiblemap center="-34.916721,138.828878" title="Adelaide Hills" showinfo="false"]

  11. title

    title of the marker, displayed in a text bubble
    [flexiblemap center="-34.916721,138.828878" title="Adelaide Hills"]

KML

  1. kmlcache

    ask Google Maps to use a new map instead of cached map, specified in minutes (90 minutes), hours (2 hours), days (1 day), or “none”; minimum 5 minutes, default “none”
    [flexiblemap src="http://example.com/map.php" kmlcache="90 minutes"]

  2. src

    the URL for a KML file to load map details from
    [flexiblemap src="http://example.com/map.kml"]

  3. targetfix

    prevent links from opening in new window, from [true, false]; default=true
    [flexiblemap src="http://example.com/map.kml" targetfix="false"]

Directions

  1. dirdraggable

    allow directions to be draggable, from [true, false]; default=false
    [flexiblemap center="-34.916721,138.828878" directions="true" dirdraggable="true"]

  2. directions

    show directions link in the text bubble; by default, directions will be displayed underneath the map, but you can specify the element ID for directions here; default=false
    [flexiblemap center="-34.916721,138.828878" directions="true"]
    [flexiblemap center="-34.916721,138.828878" directions="my-div-id"]

  3. directionsfrom

    initial from: location for directions, e.g. directionsfrom=”Sydney”

  4. dirnomarkers

    suppress start and end markers when showing directions, from [true, false]; default=false
    [flexiblemap center="-34.916721,138.828878" directions="true" dirnomarkers="true"]

  5. dirshowssearch

    show or suppress directions search form when showing directions, from [true, false]; default=true
    [flexiblemap center="-34.916721,138.828878" directions="true" dirshowsearch="false"]

  6. dirshowsteps

    show or suppress directions steps when showing directions, from [true, false]; default=true
    [flexiblemap center="-34.916721,138.828878" dirshowsteps="false"]

  7. dirtravelmode

    select directions travel mode, from [driving, bicycling, walking, transit]; default=driving
    [flexiblemap center="-34.916721,138.828878" directions="true" dirtravelmode="walking"]

  8. dirunitsystem

    force directions units to metric or imperial, from [metric, imperial, auto]; default=auto
    [flexiblemap center="-34.916721,138.828878" directions="true" dirunitsystem="imperial"]

  9. region

    specify region to help localise address searches for street address map and directions, taken from the list of
    country codes
    [flexiblemap center="-34.916721,138.828878" directions="true" region="AU"]

  10. showdirections

    show directions when the map loads; default=false
    [flexiblemap center="-34.916721,138.828878" directions="true" showdirections="true"]

Common

  1. gesturehandling

    Control how the API handles gestures on the map, including touch gestures, dragging, and the scroll wheel. From [cooperative, greedy, auto, none]; default cooperative.

    Cooperative means that the scroll wheel does not zoom the map without also holding down the ctrl key or ⌘ key, and dragging on touch devices requires two fingers.

    Greedy means that all touch and scroll events work.

    Auto means that the Maps API chooses whether to use greedy or cooperative based on the page size.

    [flexiblemap center="-34.916721,138.828878" gesturehandling="greedy"]

  2. height

    height in pixels or valid CSS units
    [flexiblemap center="-34.916721,138.828878" height="400px"]

  3. hidefullscreen

    hide the Full Screen control, from [true, false]; default=false
    [flexiblemap center="-34.916721,138.828878" hidefullscreen="false"]

  4. hidemaptype

    hide the map type controls, from [true, false]; default=false
    [flexiblemap center="-34.916721,138.828878" hidemaptype="true"]

  5. hidescale

    hide the map scale, from [true, false]; default=true
    [flexiblemap center="-34.916721,138.828878" hidescale="false"]

  6. hidestreetview

    hide the street view control, from [true, false]; default=true
    [flexiblemap center="-34.916721,138.828878" hidestreetview="false"]

  7. hidezooming

    hide the zoom controls, from [true, false]; default=false
    [flexiblemap center="-34.916721,138.828878" hidezooming="true"]

  8. id

    the CSS id of the container div (instead of a random generated unique ID)
    [flexiblemap center="-34.916721,138.828878" id="my_map"]

  9. locale

    use a specific locale (language) for messages like the text of the Directions link
    [flexiblemap center="-34.916721,138.828878" locale="nl-BE"]

  10. maptype

    type of map to show, from [roadmap, satellite, hybrid, terrain]; default=roadmap
    [flexiblemap center="-34.916721,138.828878" maptype="satellite"]

  11. maptypes

    types of maps in the map type controls
    [flexiblemap center="-34.916721,138.828878" maptype="custom_type" maptypes="custom_type,satellite"]

  12. width

    width in pixels or valid CSS units
    [flexiblemap center="-34.916721,138.828878" width="100%"]

  13. zoom

    zoom level as an integer, larger is closer
    [flexiblemap center="-34.916721,138.828878" zoom="16"]

Deprecated

Deprecated attributes are still supported, but should not be used any more. They will be removed in a future version.

  1. dblclickzoom

    enable double-clicking to zoom, from [true, false]; default=true
    [flexiblemap center="-34.916721,138.828878" dblclickzoom="false"]

  2. draggable

    enable dragging to pan, from [true, false]; default=true
    [flexiblemap center="-34.916721,138.828878" draggable="false"]

  3. scrollwheel

    enable zoom with mouse scroll wheel, from [true, false]; default=false
    [flexiblemap center="-34.916721,138.828878" scrollwheel="true"]