Questions tagged [openlayers]

Use when the version you are using of the OpenLayers JavaScript client toolkit is 3 or later

Filter by
Sorted by
Tagged with
2
votes
1answer
391 views

Ol3 Boundless - layer selector placement

I recently started playing around with ol3 + boundless. I created the edit application using > suite-sdk create myApp ol3edit. I am trying to move the layer view/selector from the map to a .col-md-...
2
votes
1answer
135 views

Openlayers 3 equivalent of render intents of OpenLayers.Stylemap?

I want to convert my openlayers 2 features to openlayers 3. I have following part in openlayers 2. I need an equivalent of StyleMap in openlayers 3 so that I can distinguish the default action and ...
2
votes
1answer
12k views

Placing GeoServer WMS layer within OpenLayers 3

I have the following basic OpenLayers 3 code that opens a OSM background mapping and this works fine: <!doctype html> <html> <head> <title>Hello PMS</title> ...
2
votes
1answer
1k views

Save features and attributes as WFS in GeoServer

I want to create some squared features with OpenLayers 4, add attributes to each feature and want to save them on the GeoServer to load them later on to another map. I am able to create the features, ...
2
votes
2answers
1k views

How to find feature in OpenLayers exsisting layer

I have a vector layer in my OpenLayers applicaiton. var layer = new ol.layer.Vector({ source: new ol.source.Vector({ url: "my geojson url" }) }) my GeoJSON data fills the ...
2
votes
1answer
730 views

Openlayers 3 getting 401 error from geoserver with secured layers

I have an OL3 webmap that is attempting to access services from Geoserver that is running on a server on our internal network that uses LDAP logins using windows credentials. I found this link (...
1
vote
1answer
519 views

Vector layer not displaying in OpenLayers

I have this code from an Udemy course. Everything works except I can not visualize the vector layer. I can see the JSON file - wfs_url correctly but not visualize vectorSource (the data points ...
1
vote
2answers
1k views

How to use Mapbox vector tiles as a vector source in OL3, so that labelling will not clip at tile boundaries

I have been able to load and display mapbox vector tiles in OL3 using a vectorTile source and a vectorTile layer. The problem with this approach is that labels will clip at the tile boundaries and ...
1
vote
2answers
1k views

Does OpenLayers 3 support WCS? [closed]

I was wondering if it is possible to display a map in ol3, which is constructed as WCS in MapServer/GeoServer?
1
vote
1answer
55 views

Putting content of popup into modal using OpenLayers?

I'm trying to put the content of a OpenLayers 5 popup into a Boostrap's modal but I cannot make it. Here the code with popup; it work fine: . . . <div id="popup" class="ol-popup"> <a ...
1
vote
0answers
26 views

Transformation issue with SVG to GeoJSON conversion

I have a vector image in SVG format. (without georeferences) I am trying to display it using OpenLayers to display properties of different polygons in it. I tried converting it to GeoJSON but the ...
1
vote
2answers
1k views

SLD_BODY in WMS Layer params is not working

I am trying to set style to my WMS layer in my script like this : http://opendem.info/ol3/wms_sld.html but I got nothing. This is my code : var sldBody = '<?xml version="1.0" encoding="ISO-...
1
vote
1answer
89 views

How to avoid empty popups when GetFeatureInfo request is empty

I set up a WMS with QGIS SERVER. I am querying it via a web app based on OpenLayers. Everytime I click on my map, I send a GetFeatureInfo to a specific layer passing the coordinates where I clicked, ...
1
vote
2answers
231 views

How to pass viewparams with vector tile request using open layers 5

I want to create an application using vector tile. I am using openlayers v.5 and geoserver 2.14.1 for this purpose. I have already rendered vector tiles, but not able to pass viewparam along with ...
1
vote
1answer
226 views

How to access geoserver web services on a backend server through openlayers web application hosted on another server via IIS?

I am struggling with how to access geoserver web services in my openlayers application. I setup a test machine that hosted both geoserver and the openlayers app as well as a postgres database to ...
1
vote
1answer
9k views

OpenLayers 3 transform coordinates to custom projection

I am trying to convert WGS84 coordinates (EPSG:4326) to Amersfoort RD New (EPSG:28992) with OpenLayers 3. I declared EPSG28992: Proj4js.defs["EPSG:28992"] = "+proj=sterea +lat_0=52.15616055555555 +...
1
vote
1answer
10k views

OpenLayers 3: Create a map based on ImageStatic and add features (polygons, linestring etc.)

I have an image that I need to create an OL3 map for, so I've done: var map; $(function() { var imgProjection = new ol.proj.Projection({ code: 'pixel', units: 'pixels', ...
1
vote
1answer
526 views

changing Bing Maps attribution

I have been doing some research and found out that i can change the attributions of TileWMS, OSM but i have found little about BingMaps. Is it possible to change the attributions of BingMaps? and how ...
1
vote
1answer
43 views

OpenLayers generating clientside PDFs

I am currently working on a solution to generate clientside PDFs from OpenLayers content. The experience is okay so far, but I am having a bit of a hassle. The abstract is as follows: Calculating ...
1
vote
2answers
890 views

Applying SLD not working in OpenLayers 3

My code is as below and I want to apply custom SLD to layer which is working for all codes in project except this one. function cusMap(strSld_body,talukaName){ alert(strSld_body); var query = new ol....
1
vote
1answer
661 views

How to indicate polygon vertices with small circles using OpenLayers?

I am using OpenLayers 3 and have more or less implemented everything in my requirements list, except one thing: I am asked to somehow make the polygon rendering indicate the polygon vertices with ...
1
vote
2answers
5k views

wmts layer in Openlayers from Geoserver

I have some layers in Geoserver(latest stable) that came from PostGIS data (they belong to a store with PostGIS type and gets data from a PostGIS database) In those layers there are only WMS settings,...
1
vote
1answer
136 views

StyleFunction Openlayers-3 - multiple callback variables?

I am using the "styleFunction" from the following example: http://openlayers.org/en/v3.9.0/examples/geojson.html var styleFunction = function(feature, resolution){ var properties = feature....
1
vote
1answer
530 views

Openlayers 3 - how to override handleUpEvent in PinchZoom interaction?

In Openlayers 3 I've been unable to get my attempts at overriding the ol.interation.PinchZoom's handleUpEvent to work. I've tried a few different ways, but but below is a basic example of what I've ...
1
vote
1answer
1k views

OpenLayers 4 adding a georeferenced image

I'm trying to add a georeferenced image layer to my map object. I'm using Node, with the v4.2.0 Openlayers module. My code to add the georefenced image is as follows. Within the layers array of the ...
1
vote
0answers
1k views

Apply css styles to layers in openlayers3

define layers and styles using openlayers3 API. I need to apply css styles for layers.for that code is in below used //applying styles for wms layer var fill = new ol.style.Fill({color: 'rgba(237, ...
1
vote
1answer
775 views

dragging while holding ctrl (control) key doesn't work in OpenLayers3?

When I hold down the Ctrl (control) key on my keyboard and attempt to pan any OL3 map with my mouse, the pan doesn't happen. Because of the particular needs of my application, I need panning to work ...
1
vote
1answer
275 views

Openlayers 3 GPX Shape issue

I've been working to incorporate GPX file handling within my application with a pretty good degree of success but have just encountered an issue which I don't know how to solve. When drag/dropping a ...
1
vote
1answer
2k views

geoserver SLD in ol3

i have some vector layers in geoserver with style (SLD) When i add these layers though OL3 i want to use same SLD. right now i am giving style to layer as below style: new ol.style.Style({ ...
1
vote
1answer
4k views

OpenLayers 3 get map by id or class?

How can I get hold of a OpenLayers3 map object associated with a specific id or class (unique)? I searched and found this thread, which says something like: var map = $('.my_map_class').data('...
1
vote
1answer
152 views

Limit ImageWMS request size

Is there any built-in way of limiting the request width/height of ImageWMS sources and have the map just scale the image up to fill the extent? I'm building an application that includes a bunch of WMS ...
1
vote
1answer
3k views

OL3 How to select features of a WMS layer

I want to show on the map the features of the saved layers from a GeoServer server, but I don't know how to do this... Like this, but with the dragbox interaction... I have this code: var select = ...
1
vote
0answers
816 views

Why ol3 google maps is blurred?

I'm developing an application using GeoExt 3(Openlayers 3.15.0 and Extjs 6.0.2). I want to use Google map as base layer using ol3 google maps. I add ol3 google maps to my project as follow: index....
1
vote
1answer
386 views

Layer specific popup template in openLayers 3

I want to define individual pop up templates for different vector layers in Openlayers 3. The layers are defined with the following options (that are passed to a constructor-function): n2k_dh_l = ...
1
vote
1answer
3k views

why can't I load a layers list to select from to the map in openLayers 3, addEventListener and attachEvent are unavailable

I've tried to incorporate this sample that shows how to switch base layers into a page I am working on: http://openlayers.org/en/v3.10.1/examples/bing-maps.html When I try to load my page with the ...
1
vote
1answer
1k views

Vector Tiles in Openlayers 3

I am struggling to understand how to render vector tiles in Openlayers 3. this is probably due to me not understanding Z/X/Y tiles. I have created an mbtile source and am serving it using tileserver-...
1
vote
1answer
654 views

How to temporary disable map click event in OpenLayers

How can I disable map click event? My idea is to disable it when I am positioned with mouse over my popup container. After I move mouse out of it, I want that event is enabled again. Something like ...
1
vote
1answer
1k views

Filter on features in a vector layer

What I try to achieve is quite simple. I want to filter my vector layer by a query in the features. What I found out is that vector layer doesn't have updateParams() where I could do something like: ...
1
vote
1answer
4k views

Export PDF from OpenLayers map with jsPDF

I try to use javascript library JSPDF for export my OpenLayers map but it doesn't work. I create my HTML : <head> <script type="text/javascript" src="script/ol_3.7.0/build/ol.js">&...
1
vote
2answers
2k views

Openlayers 4 - get all child layers in a layer group

How can I get all child layers of a given layer group in Openlayers? I go as far as establishing that a given layer is in fact a group, but then I get stumped: // Handle visibility control $('i').on(...
1
vote
3answers
6k views

OL3 check if point is inside a polygon

When I am adding a point to my web map I want to give it a letter that represents the area where the point is, so I need to know what area the point is in. In OpenLayers 2 I did it like this: areas[i]....
1
vote
2answers
273 views

How to show single title for double CSS stroke in map legend

I am using CSS for styling roads in my geoserver. Here is my css : /* @title HSAMB Roads*/ * { stroke: #333333,#00CC00; stroke-width: 3px, 1px; z-index: 0, 1; ...
1
vote
1answer
869 views

Load vector tiles (pbf) directly from mbtiles database using OpenLayers 3

In response to the answer of Klokan Technologies in this thread: OSM offline tiles -- mbtiles in openlayers. I managed to unpack a random small mbtiles vector tile map from osm2vectortiles.org and ...
1
vote
1answer
859 views

Non-english Characters in cql filter in GeoServer

I have a shapefile loaded in GeoServer 2.8 and accessed by OpenLayers 2.13. This layer is in UTF-8 encoding and has some english and non-english records. When i use english fields in cql-filter - as ...
1
vote
1answer
818 views

With a WMS server Url, how to know it is a Web map service or a Web map tile service?

I need to add wms map in my project, and the url of wms server will be provided by users. Are there any ways to know the type of server (wms or wmts) with the url proposed by users ? Or to know that ...
1
vote
1answer
938 views

OpenLayers 3 GeoJSON not loading

I am having trouble loading a GeoJSON layer (below is my defintion). Everything works fine when I read the file locally in a web browser, e.g. file:///Z:/inetpub/wwwroot/bang.html. However, when I try ...
1
vote
2answers
2k views

Getting a Python Error with OpenLayers in QGIS 2.18.15 [duplicate]

So I just recently converted to QGIS from pen and paper, and it was all fine until I opened some layers and tried to use OpenLayers for a Google Satellite view. A yellow bar appeared at the top of the ...
1
vote
2answers
227 views

GeoServer WMS layer won't load on OpenLayers 5

I was making some tests using Tiger products: I converted one .shp in a PostGIS database using shp2pgsql, then imported the db into GeoServer; the layer works fine with the preview provided by ...
1
vote
1answer
601 views

OL3: data from WFS is added multiple times

I added a ol.source.Vector to my map which receives data from a wfs. Currently I am using ol.loadingstrategy.bbox because there is a lot of vector data and it would take too much time to load it all ...
1
vote
1answer
4k views

OpenLayers 3 - Monitor layer loading progress

I'm doing an upgrade from OpenLayers 2 to OpenLayers 3. In OL2, I was monitoring the loading progress of layers with their loadstart and loadend events. With grid layers I was even able to show a ...