Questions tagged [openlayers]

OpenLayers is an open source Javascript web mapping library for creating web map applications.

OpenLayers is a JavaScript library which implements an API for developing dynamic map widgets on the web. The library provides tools for presenting and editing geographic information using pure JavaScript with no server-side dependencies.

OpenLayers supports several different access methods for geographic data, including the OpenGIS Web Mapping Service (WMS) and Web Feature Service (WFS) protocols from the Open Geospatial Consortium. Other supported geographic data sources include OpenStreetMap, Bing Maps, and ArcGIS Server. See the OpenLayers live examples page or the documentation for more comprehensive details.

OpenLayers is a project of the Open Source Geospatial Foundation (OSGeo) and is released under a BSD-style license (also known as the BSD-2-clause).

Books

OpenLayers Cookbook

Tag Usage

When asking a question with the tag, please mention the OpenLayers version you are using - especially for coding related questions.

5064 questions
10
votes
2 answers

How to load layers depending on zoom level?

I want to control the zoom in OpenLayers. When the zoom is 3 I want to load KML1 and when the zoom is 4 i want to load KML2. Could you please advise me how I can control the zoom-event?
user1365697
  • 5,819
  • 15
  • 60
  • 96
9
votes
1 answer

Geocoding without Google API?

I cant find a way to convert an adress to a long/lat coordinate without using google geocoding API. Im working with Open Layers and Open Street Map and have to avoid google api because of the 2.500 views/day limitation.
最白目
  • 3,505
  • 6
  • 59
  • 114
9
votes
4 answers

OpenLayers in Android

Has anyone tried before using OpenLayers in Android ? How did that go ? Was it accessed through the browser at a certain address or embedded in a local stand alone android application using WebViews ? , or other approach. If any references related…
klaus johan
  • 4,370
  • 10
  • 39
  • 56
9
votes
1 answer

Openlayers 4: Changing the draw order of selected features

I have a single vector layer in OpenLayers 4 (4.4.1). The layer has several features with LineString geometries. Some of the features overlap. If I click at a point where features overlap, I want only one of the features to be drawn as selected.…
Tommy
  • 368
  • 2
  • 13
9
votes
2 answers

How do I make a two-color dashed line style in OpenLayers?

I want to add a dashed stroke with two alternating colors to a feature in OpenLayers. Basically, I want to create a two color outline around polygon so that it shows up no matter what color the background is. I want the end result to look like…
Jo Sprague
  • 16,523
  • 10
  • 42
  • 62
9
votes
6 answers

How can I use an SVG image as a map marker in OpenLayers-3?

I am trying to create map "pin-drops" (ie. map markers) in OpenLayers-3 (OL3) using SVG images. Currently, I am using PNG images as the pindrops that reference the ol.style.Icon source (“src”) property attribute just fine. However, this fails using…
FreeBeer
  • 91
  • 1
  • 1
  • 4
9
votes
5 answers

Interactive World Map, highlight countries on mouseover

I need to create an interactive world map on the front page of a site, the view portal will be about 650x200 pixels. The interactivity would include the following, mouse-over a country would highlight (the countries are will literally be filled with…
BrenGG
  • 141
  • 1
  • 1
  • 5
9
votes
2 answers

How to move OpenLayers Vector programmatically?

The API documentation for OpenLayers.Feature.Vector says that Vector itself has no methods at all. I know how to let user move the Vector by adding OpenLayers.Control.DragFeature control to map. So if the user can move the Vector then there has to…
Rene Saarsoo
  • 13,580
  • 8
  • 57
  • 85
9
votes
1 answer

OpenLayers always-offline application?

None of the "openlayers offline" examples I've found seem to have an even remote understanding of what someone asking for an offline solution means. I don't want a browser cache, and I don't want an intranet server. This is for a demonstration (of a…
user2471961
9
votes
3 answers

Removing a layer in OpenLayers

I don't know why this isn't working. I would assume the answer is really simple. I need to remove a layer before adding a new one. if (graphic) { window.map.removeLayer(graphic); } var graphic = new…
Mitchell Ingram
  • 686
  • 2
  • 11
  • 23
9
votes
3 answers

Openlayers / Openstreetmap background is vertically striped and squished

So the background of my openlayers implementation appears to be squished into vertical stripes. The weird thing is that it wasn't always like this but even when I stash all my changes back to a point where I know it was working, it still is broken.…
joshontheweb
  • 612
  • 1
  • 6
  • 18
9
votes
1 answer

Change z-index of marker in openlayers

I've a layer with multiple markers with rather big icons, so they overlap. Via the list on the side of the map users can select a marker and the map will pan (and zoom) to it. But it will still be behind some other makers. How do I get a individual…
Jeroen
  • 1,638
  • 3
  • 23
  • 48
9
votes
0 answers

GeoJSON for floor plan

While evaluating different technology to represent an office floor plan (so, basically 3d geometry data and 2d representation), I came across many new javascript package for client side representation. I see suggestion to use openlayers.org, but…
bsr
  • 57,282
  • 86
  • 216
  • 316
8
votes
3 answers

Openlayers write and save a KML based on your map

Is it possible to write and save a KML from OpenLayers? Anyone know of an example of exporting one?
user1100603
  • 151
  • 1
  • 6
8
votes
2 answers

Making more than one vector layer clickable in OpenLayers

I'm working on a OpenLayers map that will display multiple KML layers at once. I want to be able to click on a feature from any layer and have a pop-up show me some info. So far I can only click on the most recently added layer. If I want to click…
etherton
  • 924
  • 2
  • 10
  • 21