Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [openlayers]

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

1
vote
0answers
53 views

Showing layers features data on click in OpenLayers5?

I am trying to display layer data on map click but I can't figure out how to do it. There is not an example of this important feature. I believe it's the getfeatureinfo event. Here is the messy API ...
0
votes
1answer
25 views

Searches by area names in OpenLayers with request of AJAX in the PostGIS database

We built a GeoJSON: {"type":"FeatureCollection","features":[{"type":"Feature","id":0,"geometry":{"type":"Polygon","coordinates":[[[669023.843,415221.025],[669031.588,415222.415],[669059.365,415154....
0
votes
2answers
36 views

OpenLayers adding/removing layer when checkbox is changed

I am trying to add and remove layers2 layer when checkbox is changed. How can I do it with jquery? Following my way i get: Uncaught ReferenceError: layers is not defined var wmsLayer2 = new ...
-1
votes
0answers
15 views

3D WebGis development for Electrical transmission lines [on hold]

What is the best way to develop the 3D mapping WebGis application for Electrical Transmission lines, preferably using open source softwares.
0
votes
0answers
31 views

Convert WMS Layers into Image is not Working but it's working for WFS

I'm using this method to convert the Map containing WMS layer to image later use that image in PDF. Everything is working fine for WFS layers but not with WMS layers. function CaptureImage() { ...
2
votes
1answer
42 views

Understanding OpenLayers code?

I'm trying to teach myself OpenLayers and took an introductory course in which we received the whole code. For my first own project I want to do something similar and recycle some of the code. But ...
0
votes
0answers
21 views

Create one function for paused animation maker in OpenLayers

function pauseAnimation() { animating = false; //===== var index = Math.round($("[id='rightfrm:tbv1:txt1']").val() * elapsedTime / 1000); (geoMarker.getGeometry()).setCoordinates(...
3
votes
1answer
58 views

Styling rendered mbtiles in offline web-map service

I am building a digital cartography tool that needs to run completely offline. As a basis, I downloaded a .mbtiles-file corresponding to the area I want to survey and I am running the excellent ...
0
votes
1answer
38 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
36 views

Openlayers error: Uncaught TypeError: t.getLayerStatesArray is not a function

I am getting the following error in the yellow background below. Can anyone explain why i get this? I am not using any bundler i include the ol.js javascript file in the footer Group.js:209 ...
0
votes
0answers
30 views

Layer not properly rendering in layer group

I have a layer group consisting of four different raster image pyramids. Three of the layers render properly but fourth is not rendering below a zoom level of 5 (it remains super blurry when you try ...
1
vote
1answer
40 views

How to add legends in map canvas when exported to PDF ol5

Here is my code to export map in PDF and map is successfully exported to PDF Now i want to add legends in map canvas but i do not know how to do that. var exportElement = document.getElementById(...
0
votes
1answer
57 views

Custom tiles with OpenLayers [closed]

I'm a new in OpenLayers and want to display my own tiles. My code is based on this example. I works well so far, but other code examples are very welcome. Now I want to create my own tiles out of ...
0
votes
0answers
24 views

Zoom to current features in SQL layer in OpenLayers 4.6?

I've created a SQL layer, I'm passing the values for that query from client, I want my map to be able to zoom to whatever the layer that comes after query. I tried GetCapabilities, but it zooms to the ...
0
votes
1answer
32 views

Clicking polygon in OpenLayers map and zooming , centering polygon in map?

I click on the map on a polygon and I'd like to zoom the map and center it around the polygon. We have done so until now: map.on ('click', function (e) {      console.log (s);     // coordinate = ...
0
votes
1answer
13 views

Clicking polygon in OpenLayers map to change color and zoom polygon centre?

My problem is when I click on a polygon element on the map I would like to color another color and zoom by centering that object automatically. map.on ('click', function (e) {       console.log (s);  ...
1
vote
0answers
34 views

Calling external plugins downloaded via Plugins through a separate out of QGIS Python Script

I was wondering if I could produce webpages daily by automatically creating a standalone python script, outside of QGIS. My webpage should ideally contain various layers and an interpolation on top ...
1
vote
1answer
33 views

OpenLayers 5 and GeoJSON with two geometry attributes per feature

I have a GeoJSON file in which each feature has two geometry attributes, one is the default geometry property defined by the GeoJSON standar, and the other one is a property under the standarized ...
0
votes
1answer
29 views

openLayers TileWMS example doesn't work [closed]

I am currently following a tutorial book that is a bit outdated, therefore I have looked at the openlayers website: https://openlayers.org/en/latest/examples/wms-tiled.html to find how to make a ...
0
votes
0answers
19 views

How to give radio button for one layer group and checkbox for other layer group in Geoext?

For Base layer group I want to display radio button and for nonbaselayergroup the checkbox should be displayed. Currently for both we are getting checkbox basicMapGroup = new ol.layer.Group({ name: '...
1
vote
0answers
30 views

Popup data does not change from one icon to another without closing the popup first

I am working on an application that will display markers on an OpenStreetMap. I can get the markers to display correctly on the map via my function, and I have assigned each marker details specific ...
0
votes
0answers
17 views

ECW errors on ubuntugis

i have successfully installed the ECW support on ubuntu qgis. the main challenge that i have is that whenever i try and load an ecw file, the qgis main window crashes. On the other had i am able to ...
0
votes
1answer
24 views

Openlayers: Display feature labels

I try to add labels of a vector I added in openlayers with a stylefunction. The function works for stroke, but no text is displayed and I can't find a solution for it. My code is the following: var ...
1
vote
2answers
36 views

Put a label on OpenLayers from GeoJSON

I have a geojson and I want every property to put a label in its middle with a number .. Here's the function I'm putting on the geojson map: function search(){ var layer = $('#layer').val(); ...
0
votes
1answer
59 views

OpenLayers 5 add multiple markers

I'm using OpenLayers 5 to show a map and add markers to it. I can see the map without any problems but only the last marker is shown. I saw an answer about using .clone() method on the marker that's ...
0
votes
0answers
48 views

Increasing size/height of OpenLayers map/canvas?

I'm trying to let the Map/Canvas height of OpenLayers 100%, but I'm not able to do it. I've already tried putting in several places the "height: 100%;" and used the "map.updateSize()" function, but ...
0
votes
0answers
31 views

View GeoJSON data after clicking on the OpenLayers map

I'm trying to make a piece of code that when I click on the map to return GeoJSON property data that I clicked on. I tried this way: map.on('click', function(e){ //console.log(evt); //...
2
votes
2answers
86 views

how to fix scale 1:4000 to export map in PDF ol3

This is my code to export map in pdf but i want to fix this map in 1:4000 scale the n export or print it to pdf. var dims = { a0: [1189, 841], a1: [841, 594], a2: [594, 420], a3: [420, 297], ...
0
votes
1answer
54 views

Drawing Sectors / Conic Sections in OpenLayers?

I am having trouble finding working examples in OpenLayers 5.3 where conic sections and/or sectors can be drawn. Does anyone have any working code or can point to the correct classes to use? Here'...
0
votes
0answers
23 views

How to give user input scale to export map in pdf ol3

I am developing a portal in which map is shown & export it to pdf. but i want to give such functionality that user select the scale and then map is fitted to that given scale then export it to ...
0
votes
1answer
46 views

Determining the center of a gradient in OL shape

I am trying to draw a circle on an OL map and have the center of it a particular color, have the color fade out to transparent as it gets closer to the edges of the circle. I have been looking at ...
0
votes
1answer
28 views

Trying to change point style -> RangeError: Maximum call stack size exceeded

I'm trying to change the style of some points of a GeoJSON file loaded in OpenLayers and I getting this error: RangeError: Maximum call stack size exceeded I want to modify the point style related ...
1
vote
2answers
38 views

Openlayers squeezes placemarks after changing map projection

I have a map with OSM as a base layers and several layers on top of that. Two layers (red polygons with gray fill and black placemarks) are instances of TileLayer (source TileWMS -> geoserver). Both ...
0
votes
1answer
29 views

get() and getProperties() are not a function, from a VectorLayer (GeoJSON)

I'm trying to get the value "GRID_CODE" from the attribute table of a GeoJSON file and keep getting this two errors: TypeError: myFeature.get is not a function TypeError: myFeature.getProperties is ...
0
votes
0answers
27 views

OpenLayers 4 change position on load and input change

I have map which should show position depends on input, which I control with switch. Long and Lat I am getting from API (depends on my input) which return to me coordinates. How can I show position ...
0
votes
1answer
44 views

Adding Yandex Satellite map in OpeLayers

How can I add Yandex satellite map in OpenLayers? new ol.layer.Tile({ title: "Yandex Uydu", baseLayer: true, visible: true, source: new ol.source.XYZ({ url: 'http://vec0{1-4}.maps.yandex....
0
votes
1answer
23 views

Find index of Linestring element at feature, when hovering - openlayers/GeoJson

I have a Geo-JSON Linestring, this is drawn by 800 elements in OpenLayers 4.6.5. I'am trying to use the map.forEachFeatureAtPixel, and print a pop-up when hovering for individual elements on the ...
1
vote
1answer
33 views

OpenLayers Load KML Layer in the background

I would like to show a polygon in OpenLayers. The polygon was defined in 3 KML files with difference level of detail, ie: Low Resolution KML (with 100 points) Medium Resolution KML (with 1000 points) ...
1
vote
0answers
17 views

How to disable imageSmoothingEnabled for geoImageLayer?

Considering the code below (which uses openlayers and Viglino's ol-ext), how do I disable imageSmoothingEnabled for the geoImageLayer? I am trying to achieve the same thing as in this question, but ...
0
votes
1answer
34 views

Layer won't show on OL map

I am new to OL and I'm trying what I thought was a pretty simple thing. I would like to see a second layer that shows lat/lon points. Is the code below the correct way to achieve it, or am I missing ...
-3
votes
2answers
56 views

Running OpenLayers from localhost? [closed]

How to run OpenLayers using localhost? I already installed Apache Tomcat and GeoServer war. In what folder should I place all the OpenLayers file?
0
votes
0answers
30 views

Adding feature to highlight layer forces redraw of original layer

I have two VectorLayers setup, one for my actual features and another one for highlights (I'm rendering ~10000 features so I have a separate layer for highlight as recommended by ahocevar). However, ...
0
votes
0answers
28 views

I can not Add GML Layer in OpenLayers 4

I use openlayers 4 and gml layer is file type, but when i add gml layer to map using ol4, i have a ploblem. Gml is polygon but it appear as some point in map. Can not anybody help me? Below is my ...
0
votes
1answer
32 views

Open Layers 5 - Dynamically toggle zoom buttons [closed]

I would like to disable the zoom in button if a user tries to zoom in past a certain level. I would like to disable the zoom out button if a user tries to zoom out past a certain level. I see that ...
1
vote
1answer
34 views

How to fix layer styling in OpenLayers 5?

I'm trying to draw a new layer every time user clicks on the map. My styling function can be seen below; function CatchmentLayerStyleFunction(feature) { var colors = ['rgba(255,0,0,0.5)', 'rgba(...
0
votes
1answer
31 views

How do I add a georeferenced JPEG with a JGW Worldfile to OpenLayers v5.3.0?

I have a JPEG file with an associated .JGW worldfile containing the following data: 0.0144218 0 0 -0.0144218 -65758.8265181 -130841.5565499 My Jpeg is 21177*14242 pixels resolution. I'm currently ...
1
vote
1answer
37 views

CORS issue loading an external local GeoJSON into OpenLlayers 5

I have a local folder on my network with my HTML file and two subfolders, one with the downloaded folder from OpenLayers (renamed ol) and the other with my GeoJSON file (data). When I try to load the ...
0
votes
0answers
33 views

WFS Transaction Post Method 403 OpenLayers 3 + GeoServer

I am having difficulty understanding the topic when it comes to XML generated from GeoServer and how can we interact with it. I want to to implement WFS transaction service and updating my attributes ...
1
vote
2answers
54 views

How to pass tile size of to 512 using OpenLayer 3 and GeoServer 2.14

I am trying to change the default tile size of 256 to 512 using OpenLayers 3. Code is working fine for normal WMS request, but giving error (tiles not loading) for WMS-C request. My sample code is: ...
1
vote
0answers
29 views

Cycles in LineString in PostGIS table?

I have a LineString table in PostGIS, which represents wiring in streets. Where the geometry column represents the wiring lines; firstpoint is the first geometry point (cable segment); lastpoint the ...