NOTICE: is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum


I want to show MAP key as it is there on

Below is my simple code for map:

<div id="ourMap"></div>

<script  src="http://www.openlayers .org/api/OpenLayers.js"></script> 
    map = new  OpenLayers.Map("ourMap"); 
    map.addLayer(new  OpenLayers.Layer.OSM());  

Is there any feature which I have to turn on to show the Map key with same feature as it is giving in above URL?

Regards, Hardik Pancholi

asked 07 Apr '14, 11:02

hardikpancholi85's gravatar image

accept rate: 0%

edited 07 Apr '14, 13:41

scai's gravatar image

scai ♦

OpenLayers doesn't support an OpenStreetMap Map Key out of the box, so there's no single feature you can enable for this purpose. Also, the OpenStreetMap main page uses Leaflet rather than OpenLayers, which makes a copy&paste somewhat difficult.

Maybe you could use this URL as a starting point to get at least the Map Key information and then enable/disable some of the elements according to your zoom layer (see data-zoom-min/data-zoom-max below). The question remains how to best embed that URL in your application. Maybe you want to use concept similar to a side bar to display your Map Key.

tr class="mapkey-table-entry" data-zoom-max="19" data-zoom-min="0" data-layer="mapnik"
permanent link

answered 21 Apr '14, 08:05

mmd's gravatar image

accept rate: 37%

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 07 Apr '14, 11:02

question was seen: 5,844 times

last updated: 21 Apr '14, 08:05

NOTICE: is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum