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
7
votes
1 answer

Using an PNG or JPEG for Map with OpenLayers (Scale/Zoom Problem)

I am using an image to display my map with OpenLayers. My JS code looks like this: map = new OpenLayers.Map('map'); var options = {numZoomLevels: 7, isBaseLayer: true, }; var globe = new OpenLayers.Layer.Image( …
Bernie Perez
  • 12,513
  • 13
  • 46
  • 55
7
votes
1 answer

Openlayers zIndex for markers and vectors

I'm rendering map with OSM and I have some serious problem with setting zIndex for page elements. Part of JS looks like this: var userRoute = new OpenLayers.Layer.Vector( "KML", { sphericalMercator : true, styleMap: styleMap, …
kamil
  • 3,482
  • 1
  • 40
  • 64
7
votes
2 answers

Draw Camera Range with Postgis

i am working on some camera data. I have some points which consist of azimuth, angle, distance, and of course coordinate field attributes. In postgresql postgis I want to draw shapes like this with functions. how can i draw this pink range…
urcm
  • 2,274
  • 1
  • 19
  • 45
7
votes
2 answers

OpenLayers Refresh Strategy Problems

I'm developing an application, part of which uses OpenLayers (calling a Geoserver-served WMS) displaying some frequently updated data (a vessel track - or more specifically, a series of points). I would like to have this vessel track updated at a…
Caligari
  • 1,381
  • 2
  • 10
  • 14
7
votes
2 answers

How to add a popup box to a vector in OpenLayers?

In a previous version of my program I used markers to mark points on the map. In the current version I had to change from markers to vectors, because I need the extra flexibility. In the markers solution I used the function below to add a popup-box…
xsl
  • 17,116
  • 18
  • 71
  • 112
7
votes
4 answers

Openlayers map in Angular is blank when switching components

I have a MapComponent which loads an OpenLayers Map. This component is re-used in various of my Angular app's pages. The map loads fine the first time. However, when I navigate to another component that contains the map, the map goes blank. In order…
bluppfisk
  • 2,538
  • 3
  • 27
  • 56
7
votes
1 answer

Save Openlayers map as PDF (offline version)

I would like to save my openlayers map as PDF. Unfortunately all the options I tried don't work. The first option, I guess the easiest one was here: https://jsfiddle.net/Ljnya5gp/1/ from which I developed something like this: function createPdf()…
Geographos
  • 827
  • 2
  • 23
  • 57
7
votes
2 answers

How to add custom data source to GeoServer WMS service?

I'm installing GeoServer as a WMS server to cooperate with OpenLayers. The trouble is that I have to use 3rd-party tile source which is provided through web service. So I guess I have to tweak GeoServer to fetch tile image from 3rd-party server and…
user617389
  • 153
  • 1
  • 2
  • 5
7
votes
5 answers

Create map legend to match OpenLayers.Style

I've created an OpenLayers.Style that colours my polygons, a style that sizes my points and all that jazz, now I want to explain to the user what those styles represent. I can't see anything in OpenLayers that allows me to draw my own legend using…
Craig
  • 8,093
  • 8
  • 42
  • 74
7
votes
1 answer

Open layers maps, with longitude and latitude get address

I am trying to get address(City, Post code,Street address) with longitude and latitude but i don`t know how. I am using Open layers and when i click on part of map a get longitude and latitude of that position. Does anybody have solution for…
Filip Filipovic
  • 410
  • 3
  • 13
7
votes
1 answer

How to retrieve geographical location from users using Angular

I'm programming in Angular with Openlayers library. I want to use this API : https://adresse.data.gouv.fr/api (the page is in french so I will explain the purpose) The goal of this API is on the one hand to search some adresses on a map while…
Adrien
  • 165
  • 2
  • 3
  • 11
7
votes
2 answers

How to filter layers using forEachFeatureAtPixel method

I'm having hard time figuring out how to filter layers using forEachFeatureAtPixel method. I was going trough documentation but without any success so far. I basically want to filter layers and apply overlay style on event (for example "click") or…
Svinjica
  • 2,389
  • 2
  • 37
  • 66
7
votes
3 answers

Integrate openlayers in vuejs application

Has anyone have any experience in integrating Openlayers in a Vuejs application? I need to display some layers on a Vuejs app. Cheers,
Wesley
  • 133
  • 1
  • 8
7
votes
2 answers

How do I add a click event on OpenLayers 4?

I need to attach an event listener to a feature in OpenLayers 4. I've tried the feature.on('click',function(){...}) but it is not working. How can i add tan event to a feature? Thank you in advance.
user9370976
  • 157
  • 1
  • 2
  • 13
7
votes
1 answer

How to position a static image overlay on top of OpenLayers 3 Map

I am using OpenLayers 3 to display indoor maps in an Angular/Ionic mobile app. The maps are static images that I am placing on top of the OpenLayers map. I am creating the map and adding the image layer like below. var extent =…
Wes Cole
  • 71
  • 1
  • 4