Custom Fields
Re-Envisioned
Support Meta Box Geolocation How to set default map bounds on OSM field?

This topic contains 1 reply, has 2 voices, and was last updated by  Anh Tran 2 months ago.

  • Creator
    Topic
  • #14598
    Resolved
    brandonjp
    Participant

    Is there currently a built-in way to set the map bounds of an Open Street Map field?

    Presently, it defaults to Dublin, Ireland @ 53.346881,-6.258860.
    osm dublin

    For now, I just changed Line 35 in my local meta-box/js/osm.js to use coordinates closer to my clients, so they don’t get confused when they see Dublin.
    https://github.com/wpmetabox/meta-box/blob/master/js/osm.js#L35

    No big deal, just curious.
    Thanks

Viewing 1 replies (of 1 total)
  • Author
    Replies
  • #14600

    Anh Tran
    Keymaster

    Hi,

    You can set the default location via std parameter, like this:

    'std' => '53.346881,-6.258860'

    By passing a pair of latitude, longitude, you can set the default location of the map.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.