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

hi, i have a google map that shows kml polygons on it by clicking the apropriate checkbox.

I would prefer to have openstreetmap as the main map instead of google but cannot find a solution to this, I know how to show the osm map but do not know how to show the kml files in exactly the same way as the google map.

Google Map test

OSM Map Test

Can you suggest or fix it so the osm map shows the kml files on it in the same was as the google one does.

OSM has an option to show kml but that is by a slide in sidebar at top right of screen but this is not what i am after, am after the checkbox style same as google map.

the scripts are files are on the links above

I did see a similar osm checkbox but as its in .asp i cannot view the sourcecode.

asked 13 Jan '15, 23:34

mini_egg's gravatar image

accept rate: 0%

edited 15 Jan '15, 00:44

aseerel4c26's gravatar image

aseerel4c26 ♦


You didn't say which map library you were using, and the pages currently say "offline".

(14 Jan '15, 10:11) Vincent de P... ♦

my web links are working try again, maybe you just caught an outage

(14 Jan '15, 21:26) mini_egg

There are many different libraries you can use. Using leaflet for example, follow the quickstart and layer group tutorials, to get you started, and use one of the existing plugins to load the KML.

permanent link

answered 14 Jan '15, 10:15

Vincent%20de%20Phily's gravatar image

Vincent de P... ♦
accept rate: 19%

i have looked but nothing does what i am looking for and the site that does similar to what i am after is an asp and source code cannot be looked at

(14 Jan '15, 21:27) mini_egg

So it seems that you are using OpenLayers, where recent version is 3.1.1 in these days.

I found some examples when browsing to -> Examples ... and the doing a text search in my browser for "KML", "layer", "switch" or similar.

Is there really NO example that comes near your aim? And tell us the closed source ASP based website you mentioned ... maybe we can help you even better then.

permanent link

answered 15 Jan '15, 18:42

stephan75's gravatar image

accept rate: 6%

I gave the link with the asp. Click on this link and look at the source code you will see some of the code is linked to a asp page, as all the kml files are not shown so they ar4e obviously hidden in the asp file.

(16 Jan '15, 00:24) mini_egg

I cannot find any exaple that does exactly what i am after, i am looking for exactly the same style as the google example where checkboxes are shown below the map and ticked to highlight polygons. I am wanting the person to specificially choose which polygon to view. the openlayer examples have kml show on a map like the earthquakes but it does not allow you to switch on or off them

(16 Jan '15, 00:25) mini_egg

Hmm ... I am no expert in OpenLayers or Leaflet ...

So what about asking your concrete aim at the googlecode mailinglist forums of both projects?

I am sure that there are some experts who can help you.

(16 Jan '15, 18:45) stephan75

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: 13 Jan '15, 23:34

question was seen: 4,766 times

last updated: 16 Jan '15, 18:45

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