Insert a custom OpenStreetMap widget map pointing to a (your) localization : great for "Contact" page !
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

OSM Website Widget

OSM Logo
Insert a custom Open Street Map (OSM) widget map pointing to a specified location in just 3 min !
You don't need to code anything, neither to be a great designer : simply copy-paste these little pieces of code at the specified place 😋 You'll just need to create a MapBox account to use great background design. It's free and Open Source, perfect for a Contact Page, a Column or Widget... !

/// What you need

Displayed marker's GPS Coordinates

  1. Use OSM to find the coordinates,
  2. Replace [XXX-LATITUDE-XXX, XXX-LONGITUDE-XXX] inside javascript_part.js file with your coordinates → example : [53.266803,-9.046916]

Map Center's GPS Coordinates

Same method. Obviously, you can use the same coordinates as your marker. Then, replace [XXX-LATITUDE-CENTER-XXX, XXX-LONGITUDE-CENTER-XXX] inside javascript_part.js code.

MapBox background

  1. Create an account on MapBox website :
  2. Get your individual Access Token : "Account" > Tab "API access token" in the upper right menu > click on "Default Public Token" to show your Access Token
  3. Replace XXX-YOUR-MAPBOX-ACCESS-TOKEN-XXX inside javascript_part.js code.
  4. Choose the type of background you want to use for your widget : light / dark / streets / outdoors / satellite... and set id: 'mapbox.streets' inside javascript_part.js code.

/// How it works

  1. Insert head_part.html code inside the <head></head> Tags of your website. Thanks to keep credit's mentions 😄
  2. Insert css_part.css code into <style></style> Tags inside <head></head> Tags just after head_part.html code,
  3. Insert body_part.html where you want to display your map,
  4. Insert javascript_part.js inside <script></script> Tags, just after body_part.html,
  5. Brew a delicious tea 🍵 & enjoy !

/// Credits

(CC-BY) Creative Commons Attribution
Guillaume ROUAN | 2016
💬 Github/Twitter : @grouan |