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
1
vote
0 answers

Openlayer pan using only mouse middle button

I need to build a custom pan for openlayer(ol3) map using press and drag mouse middle key only. This is what i need. new ol.interaction.DragPan({ condition: function(event) { // return event.originalEvent.ctrlKey // need event for mouse…
Atanu
  • 337
  • 2
  • 14
1
vote
4 answers

Using angular 7 universal with Openlayers 5

I've got an angular 7.2 app using open layers 5.3. I'm trying to set up angular universal for this app, but when I run the universal server (node dist/server.js), I got some errors due to client only variables not being defined, such as…
David
  • 33,444
  • 11
  • 80
  • 118
1
vote
0 answers

Openlayers: Add a list of Points to a Layer

I have a problem adding a list of points to a vector source, a layer and finally to the map in Openlayers. In the beginning I create an empty array, after that I iterate over a given data set and create a new Point with an Icon and a text field for…
1
vote
2 answers

How to improve load speed of a big editable layer with OpenLayers?

I'm facing a performance issue to load a layer fastly. I'm working with OpenLayers 5.3, GeoServer 2.10 and an Oracle 12 database. I have some (3-4) WMS layers for information and background, and a WFS layer that can be edited. This last one has…
JCB
  • 99
  • 2
  • 11
1
vote
0 answers

kml style on draganddrop and ol.interactionSelect

With ol 4.4.2 kml style with drag and drop is very difficult and I can't set it by the layer style. I can style it through the feature, but when I do, it's the style of the select interaction that does not work anymore. The extractStyle: false does…
ericire
  • 409
  • 6
  • 22
1
vote
1 answer

Why do i get a NoSuchAuthorityCodeException when creating a CoordinateReferenceSystem?

I have a coordinate in the format EPSG:3857 and need to transform it to EPSG:4326. For the transformation I use geotools. When looked up every example I could find but I seem to get an exception that is not explained anywhere. Here is what I try to…
Marcus Lanvers
  • 383
  • 5
  • 20
1
vote
1 answer

Own removeLastPoint() function for Polygons in OpenLayers

I'm trying to fix on my application problem with removeLastPoint() function from OpenLayers. The problem is that on mobile devices removeLastPoint() is removing points on wrong order. On desktop mode everything is working well. Here is the explain…
Presto
  • 888
  • 12
  • 30
1
vote
0 answers

OpenLayers 5 - Highlight feature on select

I have a feature that has a custom style (color). When I click on it, it does not highlight. However, if I edit the code by commenting out the myFeature.setStyle(myStyle) call it highlights as expected. Is there a way to force it to highlight…
ekjcfn3902039
  • 1,673
  • 3
  • 29
  • 54
1
vote
1 answer

How to add many markers with custom text to openlayers 5

I'm using openlayers v5.3.0, and actually loading a map with many markers (in the snippet are a small subset, in my code there are thousands). What i want to do is to customized those markers, styling them with differents colors and text. How can i…
GiuServ
  • 1,215
  • 1
  • 13
  • 33
1
vote
0 answers

OpenLayers: layer does not fill the container

I am trying to show a map on a page via OpenLayers and it looks ok, but I have noticed that when I save map using toBlob as a .png image size is wrong. Then I have taken a look into html code and I have noticed that the actual size of the layer is…
Milten
  • 11
  • 2
1
vote
0 answers

OpenLayers 5 wms tiled map wrapping with Gall-Peters projection

With OL5 I'm trying to use a map with Gall-Peters projection with this definition: var projname = 'EPSG:22'; var projdef = '+proj=cea +lon_0=0 +lat_ts=45 +x_0=0 +y_0=0 +ellps=WGS84 +units=m +no_defs'; var petersProjection = new Projection({ …
gislars
  • 11
  • 1
1
vote
0 answers

How to prevent OpenLayers from applying pixel hinting?

I am using OpenLayers 5.3.0 and I found that it applies pixel hinting to the styles. Two concentric circles are aren't perfectly centered. This is the code for the style to render a specific feature: style = [ new Style({ …
francescortiz
  • 531
  • 4
  • 13
1
vote
1 answer

javascript sode for mouse position display and Geolocation with openlayer and geocodezip example

I want to combine Geolocation and Mouse Position Display (lng/lat; outside of map)from the Openlayer and geocodezip site.I tried various combinations of codes But only the Mouse Position Display (lng/lat; outside of map) is correct.Geolocation does…
Ali Hosein pour
  • 220
  • 4
  • 19
1
vote
1 answer

save canvas map with a tile Open Layer

I am using OpenLayer to show the map on website. On map I put a tile info with some information.
            
I have an option…
user0810
  • 886
  • 5
  • 19
  • 33
1
vote
1 answer

OpenLayers View center of rotation

I am preparing a map application using OpenLayers. My customer wants to have his position displayed at bottom of the screen and he wants the map to rotate around him. As far as I know, positioning the map is done using…
user3523426
  • 836
  • 3
  • 11
  • 26
1 2 3
99
100