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
12
votes
3 answers

OpenLayers : How to calculate distance between two points?

How can one calculate the distance in OpenLayers between 2 points using Mercator projection? Thanks
Jimmy
  • 123
  • 1
  • 1
  • 5
11
votes
3 answers

OpenLayers - HTML DIV overlay

I'm using OpenLayers to display a map on a standard HTML page, and I want to create a div that sits on top of the map. However, the div always seems to be obscured by the map tiles. I believe there is a way to add elements to the map itself, but in…
Barguast
  • 5,926
  • 9
  • 43
  • 73
11
votes
2 answers

OpenLayers: get Map, View, TileLayer and OSM from server

I am new using OpenLayers (an open-source JavaScript library for displaying map data in web browsers as slippy maps). I am using it with Thymeleaf (a Java XML/XHTML/HTML5 template engine that can work both in web and non-web environments). I am…
Nuñito Calzada
  • 4,394
  • 47
  • 174
  • 301
11
votes
1 answer

Openlayers: Vector Features instead of Markers

I want to place a symbol o a Map. E.g. So far I have used OpenLayers with OpenLayers.Layer.Markers. The code looks like this: map = new OpenLayers.Map('map'); layer = new OpenLayers.Layer.OSM( "Simple OSM Map"); map.addLayer(layer); …
max
  • 29,122
  • 12
  • 52
  • 79
11
votes
2 answers

Upgrade to Google Maps version 3, or go to OpenLayers?

I manage the development of some academic web mapping software for authoring collections of geographic data. It's a fairly simple interface for creating historic maps. The project is based on Google Maps v.2, and because v.2 is going to be…
Dave Shepard
  • 517
  • 2
  • 12
11
votes
1 answer

How to do OpenLayers map height 100% on bootstrap

I want to 100% of the height.
working…
barteloma
  • 6,403
  • 14
  • 79
  • 173
11
votes
2 answers

Finding coordinates of a point in OpenLayers

How can one get the coordinates of a particular point on a map in OpenLayers?
cuser
  • 432
  • 1
  • 5
  • 13
11
votes
9 answers

OpenLayers: How to refresh map after changing the vector layer

In OpenLayers, I have a cluster strategy to limit how many features/points the user sees on the map. When the user is fully zoomed in however, I want to turn off the clustering strategy so that all features are shown. To do this I am catching the…
Matt Roberts
  • 26,371
  • 31
  • 103
  • 180
10
votes
0 answers

Workaround for bug on Chromium WebView about high load causing partial rendering on canvas

I found [1] this issue on newest WebView of Chrome. To produce it you need three things: You have updated WebView to version from 15.11.2021 HardwareAcceleration in AndroidManifest is set true When you heavily give stuff to render for webview, you…
mico
  • 12,730
  • 12
  • 59
  • 99
10
votes
4 answers

Openlayers and events on multiple layers (OpenLayer.Layer.Vector)

Another day working with openlayers and another problem. Namely - i have multiple vector layers on top of each other for different types of stuff (cars, trips from history and areas). They all have events that im trying to catch... But as Niklas…
Odif Yltsaeb
  • 5,575
  • 12
  • 49
  • 80
10
votes
2 answers

get coordinates event map openlayers 4.6.5 ~ 5

I try to get the coordinates of a click on a openlayers map. My code is as follows: const localmap = new ol.Map({ layers: [ new ol.layer.Tile({ source: new ol.source.OSM() }) ], target: 'map', view: new ol.View({ …
Clement
  • 281
  • 1
  • 2
  • 8
10
votes
1 answer

OpenLayers, Layers: Tiled vs. single tile

Each time we add a new layer to our OpenLayers based website (data provided primarily by a GeoServer server), we discuss whether to use a single-tile or a tiled approach. Some of the parameters we evaluate are the following: Using the tiled…
Chau
  • 5,540
  • 9
  • 65
  • 95
10
votes
2 answers

Updating to OpenLayers 3

I'm looking to update my application from OpenLayers 2 to OpenLayers 3. Is anyone aware of a Migration Guide (or something similar) that would help with this?
sfletche
  • 47,248
  • 30
  • 103
  • 119
10
votes
6 answers

Disable zoom with Openlayers

i'm using OpenLayers to display custom OSM maps on my website. I've some points to respect: the map have to be fix (meaning that we can't drag it or zoom it). I have a problem with the zoom, i can't manage to disable zoom with the mouse. Does anyone…
GeoffreyB
  • 1,791
  • 4
  • 20
  • 36
10
votes
2 answers

OpenLayer Coordinate System

I'm struggling to understand the coordinate system used by OpenLayers. Leicester, UK is at approx. Latitude: 52.63973017532399 Longitude: -1.142578125 But to display the same location using OpenLayers I have to use: Latitude: …
Craig552uk
  • 651
  • 1
  • 5
  • 15