Questions tagged [openlayers-3]

OpenLayers 3 is the complete rewrite of the OpenLayers 2.x mapping library, targeting modern features of HTML5 and CSS3. It is not compatible with OpenLayers 2. OpenLayers is completely free and open source, having been released under the 2-clause BSD License.

OpenLayers 3

OpenLayers 3 is a high-performance, feature-packed library for creating interactive maps on the web.

Beginners may wish to consult the following resources:

Usual search keywords are 'OpenLayers' and 'ol'.

Source code can be found on GitHub at https://github.com/openlayers/openlayers.

Tag usage

Use of the tag was encouraged by OpenLayers developers for questions specific to OpenLayers 3, but it no longer is. The tag will probably get more attention.

2413 questions
6
votes
1 answer

OpenLayers 3 How to register Feature Modified event as "featuremodified" in OpenLayer 2

I need to implement Undo / Redo functionality using OpenLayers 3 vector editing (just like demonstrated in http://dev.openlayers.org/examples/modify-feature.html for OpenLayers 2). To keep track of geometry changes of features, I have to manage a…
abdul-wahab
  • 2,182
  • 3
  • 21
  • 35
6
votes
1 answer

How to get a label bold in open layers 3?

I'm labelling markers in a vector layer. TextOptions of a ol.style.Text object include arrording to the docs (http://ol3js.org/en/v3.0.0-beta.1/apidoc/ol.style.html#TextOptions) no option to change font-weight. In ol2 I used: fontWeight:…
Alex
  • 2,117
  • 5
  • 28
  • 36
6
votes
3 answers

Is there an event for when features are selected in OpenLayers 3?

http://ol3js.org/en/master/examples/select-features.html Given the above examples, what extension points are there for hooking into when features are selected?
Poul K. Sørensen
  • 16,950
  • 21
  • 126
  • 283
6
votes
3 answers

How can I serialize all features on a layer to json using openlayers 3

I want to allow a user to draw a polygon on a map using openlayers 3 and then when the user presses "save" I want to put the json for the polygon into a hidden field so that it can be sent back to the server and saved in a database. I have the code…
Tim T
  • 361
  • 3
  • 7
5
votes
0 answers

Module not found: Error: Can't resolve 'openlayers' using TypeScript definition file

In a Visual Studio 2017 React application using TypeScrpt there is a component (Map.tsx) that utilizes OpenLayers v4.6.5. The package.json file loads both the @types/openlayers and the "ol" module. { "name": "mhc-maps", "private": true, …
ChrisP
  • 9,796
  • 21
  • 77
  • 121
5
votes
3 answers

Access default OpenLayers style

I have a ol.StyleFunction set on a layer. function style(feature: ol.Feature, resolution: number): ol.style.Style { return ol.style.Style({ // stuff from the feature properties }); } Not all of the features contain their own styling…
Ilia Choly
  • 18,070
  • 14
  • 92
  • 160
5
votes
2 answers

How to remove layers by name - openlayers 3

I was add vector layer with wkt source to map with below code: var SelectVector = null; for (var i = 0; i < wktarray.length; i++) { var wkt = wktarray[i]; var format = new ol.format.WKT(); var feature = format.readFeature(wkt, { …
Farzaneh Talebi
  • 835
  • 4
  • 22
  • 47
5
votes
3 answers

Serve GeoServer Tiles in XYZ format

I am using GeoServer and seed tiles on my server. The tiles are created successfully but i dont know which pattern the directory structure is following... (i.e. .../EPSG_4326_05/0_0/00_06.png) I want to use the tiles in a OpenLayers application and…
Martin Bauer
  • 71
  • 1
  • 1
  • 4
5
votes
1 answer

OpenLayers 3: Scaling canvas with text with 125% DPI since v4.x

I've created two identical fiddles with different OpenLayers-Versions: OpenLayers v3.18.0 and OpenLayers 4.1.1 The objective is to export a PNG in high resolution. I didn't include the actual exporting of the file. It is explained here if…
NoRyb
  • 1,472
  • 1
  • 14
  • 35
5
votes
3 answers

can openlayers 3 render the animated marker using gif

I wanna ask how to make the marker show animated gif picture like openlayers 2 do...it can show the animated marker..what I want is show animated gif marker not make a marker move..it is possible or not? style = { anchorXUnits:…
Yung Fei
  • 75
  • 1
  • 9
5
votes
2 answers

view.fit() using view.animate() in OpenLayers 3.20+

I have the following code, written for OpenLayers pre 3.20: fitViewToFeature: function (viewer, feature) { var pan = ol.animation.pan({ source: viewer.olView.getCenter(), duration: 1000 }) var zoom = ol.animation.zoom({ …
hyperknot
  • 13,454
  • 24
  • 98
  • 153
5
votes
1 answer

Openlayers 3: animate point feature

I have the current set up here: fully functional fiddle example and I need to animate the point feature... make it pulse like a GPS location on Google etc. I have found this article: http://openlayers.org/en/master/examples/feature-animation.html…
Helen Danger Burns
  • 421
  • 2
  • 9
  • 28
5
votes
0 answers

Can OpenLayers3 reproject vector tile (MVT) layers?

I'm trying to use OpenLayers to display vector tile layers and basemaps that I've created and am serving. The raster basemaps I'm using are in EPSG:4326, and I'd like to overlay the MVT layers, reprojected into EPSG:4326 as well. However, it's not…
jrodjpl
  • 113
  • 7
5
votes
1 answer

How to style layers with SLD in OL3

It seems like not long ago in OL2 there was a nice way to style layers with SLD and it seems like now it is not possible to do the similar thing in OL3. At least, I could not find any example on the web and in official OL3 documentation I could not…
Jacobian
  • 10,122
  • 29
  • 128
  • 221
5
votes
1 answer

Different color border-bottom in ol.style.stroke

In OpenLayers 3 is possible to change border color in a selection: style = new ol.style.Style({ stroke: new ol.style.Stroke({ color: 'blue', width: 2 }) }); But is possible to change only border-bottom ? Something like: style…
Toni BCN
  • 291
  • 4
  • 16