Maplace.js

Markers and popups

One marker

The smallest map there is: one location, drawn as one marker.

Markdown

Map and code

Run the examples on

Loading the map…

The map couldn't load.

Loading the map…

The map couldn't load.

Loading the map…

The map couldn't load.

Loading the map…

The map couldn't load.

Loading the map…

The map couldn't load.

Loading the map…

The map couldn't load.

Loading the map…

The map couldn't load.

Loading the map…

The map couldn't load.

These maps come from Google Maps and OpenFreeMap, which see your IP address. They stay off until you say so, once for the whole site. What loading the maps sends

<!doctype html>
<script src="https://cdn.jsdelivr.net/npm/@maplacejs/maplace@1/dist/maplace-element-maplibre.iife.js"></script>
<maplace-map>
  <maplace-location location-id="london" lat="51.5074" lng="-0.1278" title="London"></maplace-location>
</maplace-map>

How it works

The shortest map: one place, its pin on the map, and the map centred on it.

  • HTML: a <maplace-location> with location-id, lat, lng and title inside a <maplace-map>, which draws at a default height (Location attributes).
  • Script and Bundler: createGoogleMap(container, { locations }), or createMapLibreMap on MapLibre; each location needs an id and its position (Every location).
  • React: a <MaplaceMap> inside a <MaplaceProvider locations={…}> (<MaplaceProvider>).