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
0answers
675 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 ...
1
vote
1answer
252 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 || {}; ...
1
vote
2answers
205 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
213 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
842 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
151 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
597 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
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
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
0answers
24 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
1answer
370 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
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
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 ...
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
1answer
771 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
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
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
1answer
928 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
0answers
798 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
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
1answer
135 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
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
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
1answer
519 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
2answers
887 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
2answers
268 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
268 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
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
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
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
648 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
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
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
514 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
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
1answer
585 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
508 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
854 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
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
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
810 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
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 +...
0
votes
1answer
11k views

OpenLayers 3 WMS GetFeatureInfo popup

I have a map a at the link below: http://gis.xyz/openlayers/openlayer.html I added one of my GeoServer WMS layers to the map, now I try to add the attributes window pop up on click. I found to ...
0
votes
1answer
2k views

openlayers 4: force refresh tiles in ol.source.VectorTile on interval

I'm using openlayers 4, and have a ol.source.VectorTile which uses MVT tiles. I want to refresh the tiles every 5 seconds without refreshing the browser. I've used source.changed(), source.refresh(), ...
0
votes
1answer
363 views

What should I start with Web GIS MapServer?

I'm not native English Speaker and I'm a graduated student who wants to have a masters degree in software engineering. I have a thesis relative with "Build a Web GIS for air pollution in Viet Nam's ...
0
votes
1answer
1k views

Apply an SLD saved on Geoserver to OpenLayers 3

I am a complete beginner in JavaScript, XML and coding in general (so if there's anyway for me make my question more clear please tell me). I have loaded a WMS onto my OpenLayers 3 map. The relevant ...
0
votes
1answer
948 views

How to convert drawn vector feature from EPSG:900913 to EPSG:4326

My script allows you to drawn shapes on an OpenLayers map, and then to get the WKT information from that shape, except the returned coordinates are in EPSG::900913 and I need them to be in lat/lon.
0
votes
1answer
3k 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 ...
0
votes
1answer
254 views

OpenLayers getGetFeatureInfoUrl in other projections

My data is in SRS EPSG:4326. My map (view/layers) are in the default EPSG:3857. I want to just work in the data projection and would like to query a feature on map click with my data projection ...
0
votes
1answer
303 views

WFS not working in Openlayers, working in qgis. WMS working ok

If I try to import data from WFS service https://mrdata.usgs.gov/services/ca? into qGIS, it is working normally. But when I try to make html/js file on local machine using WFS service functionallity, ...