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
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
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....
0
votes
0answers
72 views

Layer does not displaying

I am working on a heat map that will show by region the number of issues found in which area. The code are not displaying any error on console, my functions which parse my data are ok (I have just ...
0
votes
1answer
741 views

Read WKT geometry using JTS 1.13 in Java

I want to create a shapefile from coordinates, in the client side I take the coordinates of a polygon by OpenLayers, it sends it to a Java class, in this class I read the geometry of the polygon, but ...
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
46 views

Create rectangle with center point , height and width ol5 API [duplicate]

I am trying to develop a web portal using ol5 API where user click on map and then it takes map click event coordinates as centroid of rectangle and create a rectangle of particular height and width. ...
0
votes
2answers
1k views

How to define styles for features in JSON file

Styles for rendering features in OpenLayers 3 are defined as: new ol.style.Style({ image: new ol.style.Circle({ radius: 6, stroke: new ol.style.Stroke({ color: 'white', width: 2 ...
0
votes
1answer
678 views

Openlayers 3 + WFS GML2 layer wrong projection and displaying on wrong location

I have requested vector layer through WFS GetFeature from GeoServer in GML2 format but when displaying WFS layer its showing on different place. same layer i have requested in format Geojson its ...
0
votes
1answer
961 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
1k views

Openlayers 3 how to get if an image loaded ol.source.Image

I'm trying to detect if an image exists or not when I try to load it. layerPrec = new ol.layer.Image({ name: "imgprec", style: 'imgprec', ...
0
votes
2answers
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
572 views

How to create GeoJSON constructor in openlayers 3?

I wan't to add several GeoJSON-overlay layers from a Postgis-database to an Openlayers 3 map. I want to define the source as well as the style, the layer is rendered in ol 3. Actually I'm using a ...
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
806 views

OpenLayers does not display vector tiles in their origin projection

I have 3 vector layers and one raster which I want to display with OpenLayers. I used Geoserver and Geowebcache for creating VectorTiles cache (in EPSG:4326). These cached layers displayed well in ...
0
votes
1answer
324 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, ...
0
votes
2answers
414 views

OpenLayers 5 - WFS Projection Issue

I'm having trouble rendering my WFS features in projection EPSG:4326, the below code works when I switch projection to EPSG:3857 (and change the center), it works fine. I've checked the response from ...
0
votes
1answer
82 views

Why text labeling is blur when export to pdf ol5

Here is my code that displays wms image on map. filter="VILL_NAME" + "=" + "'" +cad+ "'"+ " AND TEH_NAME" + "=" +"'" +tahsil+ "'"+ " AND DIST_NAME" + "=" +"'" +dist+ "'"; cadLayer =new ol....
0
votes
1answer
294 views

Openlayers 4 WFS & vector select

I want to convert this project for other use from OL2 to OL4 but I can't convert the code and get back a map, http://www.trafficorders.uk/ here the OL2 code: layer = new OpenLayers.Layer.WMS("...
0
votes
1answer
729 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 ...
0
votes
1answer
359 views

OpenLayers4 stop interaction

I'm trying to add the measure function to the map but I want to active/deactivate the function on a value. This is the measure code: function measure() { var sketch; var ...
0
votes
1answer
3k views

Adding a projection in OpenLayers

I am following these instructions in order to define my projection for my map. And then use the ol.proj.transform function to transform the coordinates. So my code snippet is the following: var ...
0
votes
1answer
2k views

Add GML Layer in OpenLayers 4

I'm using OpenLayers 4 to build a web map. Now I'm trying to add a GML layer to the map but only one feature of the layer/GML is painted in the map. So I don't know what could be wrong. The way I am ...
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
366 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
335 views

OL3 parser flips the coordinates

When requesting featureInfo from MapServer using getGetFeatureInfoUrl() of OL3 lib var req_url = the_layer.getSource().getGetFeatureInfoUrl( evt.coordinate, map.getView().getResolution(), map....
0
votes
1answer
654 views

View Animation of OpenLayers

When I learned View Animation of OpenLayers I encountered a part of the code that I did not understand. The source address is http://openlayers.org/en/latest/examples/animation.html. function ...
0
votes
1answer
266 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
2answers
788 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 ...