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
688 views

Not displaying any layers in OpenLayers

I am creating a map that contains some layers, all defined in an array called basemapsArray var map = new ol.Map({ layers: basemapsArray, controls : ol.control.defaults({ zoom : false ...
2
votes
1answer
152 views

Reproject xyz-tilelayer to Mollweide

As OpenLayers supports raster reprojection I would like to make it reproject xyz-tilelayers e.g. from OSM, Mercator projection to Mollweide projection (ESRI:53009). From this example I took the ...
2
votes
0answers
778 views

Style GeoJSON layers depending on attributes in Openlayers 3

I'm trying to mimic most of the great google-vector-layers and leaflet-vector-layers from Jason Sanford (https://github.com/JasonSanford) to easily display, style and add customized popups for data ...
2
votes
1answer
421 views

OpenLayers setMap function is removing controls I have added

I'm trying to extent Ol.Control with my own controls, like this: class ZoomHistory extends ol.control.Control { constructor(opt_options) { var options = opt_options || {}; ...
2
votes
1answer
2k 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: ...
2
votes
0answers
174 views

Bind Vector Geometry to ViewModel or How to keep track of modified points?

I'm trying to create a viewModel for my application and the data is typically populated by a call to a database. I can retrieve the coordinates and convert this to geometry which can be displayed on a ...
2
votes
1answer
424 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
4answers
8k views

Disabling map drag and zoom in OpenLayers 3?

I need to disable all map interactions, like map zoom, drag, scroll zoom, any kind of interaction. Is there some easy way to do it?
2
votes
2answers
5k views

Using wfs-t in OpenLayers 3?

I'm using OpenLayers-3.6.0 in a web application. I have wfs layer as follow: var url="http://localhost:8080/geoserver/wfs?&" + "service=wfs&version=1.1.0&request=GetFeature&...
2
votes
2answers
662 views

OpenLayers 3 not recognising proj4 custom projection

I'm trying to create a proj4 custom projection for use with my openlayers map. However, when after creating the projection with proj4 I am unable to use it with openlayers projections because ol.proj....
2
votes
1answer
4k views

OpenLayers 3 how to keep original image extent

I'm new at ol3, I'm trying to display my GIS view by updating my ol2 code. I created the projection and I can display my static image but I'm obliged to use local extent [0, 0, 1024, 968] instead of ...
2
votes
1answer
2k views

Openlayers 3 Circle Vectors Not Visible

I have two coordinates which are projected in EPSG: 3857 coord1 = [-10399758.486973494, 5604341.818491254] coord2 = [-10402629.416641055, 5593700.936383396] I'm trying to get them to appear, ...
2
votes
1answer
140 views

Display ESRI MapService (WMTS) with EPSG:28992 coordinate system in OpenLayers web map with OpenStreetMap base layer

ESRI MapService https://tiles.arcgis.com/tiles/nSZVuSZjHpEZZbRo/arcgis/rest/services/Historische_tijdreis_1870/MapServer have EPSG:28992 coordinate system. In QGIS I can add this layer via WMTS https:/...
2
votes
2answers
165 views

Looping through an array to show multiple points on the map [closed]

I am trying to add multiple points on the map. Data comes from the server as a multi array. JSFiddle. Notice that all points share the same name (when clicking on the point) This is the response ...
2
votes
1answer
4k views

Using WKT.writeGeometry for 'Circle' Geometry in OpenLayers?

In my application which I'm building using OpenLayers3, I'm trying to extract the geometry of a feature to WKT using var format = new ol.format.WKT(); console.log(format.writeGeometry(geometry)); by ...
2
votes
1answer
2k 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
1answer
393 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 ...
2
votes
2answers
5k views

Change OL3 drawing cursor (blue circle)

i'm looking to change the cursor of ol3 during drawing from blue circle to crosshair, i've tried this answer, but it changes only OS cursor not ol3 cursor, is there any idea ?
2
votes
1answer
13k 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
2k 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 ...
2
votes
1answer
11k 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 +...
2
votes
1answer
918 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 (...
2
votes
1answer
4k views

OpenLayers 4 does not display vector layer from geoJSON

I am using OpenLayers 4.0.1 and here is my json in pastebin, because it is too large for embedded code: http://pastebin.com/VfLn0RR0 Projection of vector data is 4326 LineString. html code: <div ...
2
votes
2answers
1k views

Is ServerVector broken in OpenLayers 3.5?

Is ServerVector broken in OpenLayers 3.5? Just running the following gives an error: var wfsTest = new ol.source.ServerVector({ format: new ol.format.GeoJSON() }); The error is: "Object doesn't ...
2
votes
1answer
154 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 ...
1
vote
2answers
2k 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
719 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
1answer
78 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
2k 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
2answers
447 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
0answers
37 views

OpenLayers fill opacity increases after repositioning [closed]

I have created a test project where i'm trying to learn how to work with OpenLayers. I try to do a get request to a remote geoservice. Every time I reposition the filled polygons on my map get there ...
1
vote
1answer
40 views

Can show only one icon using style function

I am trying to add two icons to the map and add border to these two icons. However, only one icon gets the border and other icon does not even show up on the map. It is the same with more than two ...
1
vote
1answer
168 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
0answers
582 views

Uncaught Reference Error: init is not defined

I am getting the above error on my HTML file @ line number 22. I tried several attempts and was unable to resolve it. Here is the HTML code: <!DOCTYPE html> <html lang="en"> <head&...
1
vote
1answer
197 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
4k 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
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
883 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
1k views

openlayers interaction only on left mouse

Using openlayers (latest - 4), I have a drawing interaction that draws a circle - let drawCircle = new ol.interaction.Draw({source: source, type: "Circle"}); map.addInteraction(drawCircle); Both ...
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
638 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
478 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
2k 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
11k 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
605 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

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
2answers
3k 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
2answers
869 views

Display GeoServer's UTFGrid output in OpenLayers 3

GeoServer added UTFGrid output for vector features starting from the 2.9-beta version. It is implemented as a WMS service output format. After installing GeoServer 2.9-beta, adding a datastore with a ...
1
vote
1answer
851 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
300 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 ...