openlayers-3

OpenLayers3 no refresh WMS in zoom-in

徘徊边缘 提交于 2019-12-11 15:29:18
问题 I have an aplication, made with OpenLayers3, GeoServer and ReactJS, showing some WMS. And for a strange reason I can't manage to refresh the image when I zoom in ONLY if the screen resolution is wider that 1314px. It's very strange, if the resolution is for example 1310, I can do normally zoom-in and zoom-out and the wms got refreshed after every zoom, BUT, if the resolution is wider than 1315px, ONLY zoom out works, but not zoom in. Any one had experimented something like this before? This

Unable to use OpenLayers library in Browser Debugger Console (React JS)

女生的网名这么多〃 提交于 2019-12-11 15:14:53
问题 I am having one application which has OpenLayers Map and implemented using reactjs with OpenLayers library. I am trying to get the latitude and longitude of the map from the browser console in order to use the same in my selenium automation. I am using the below code in the console and getting an error as below Error: "Uncaught TypeError: map.getLayers is not a function at <anonymous>:1:5" Script: map.getLayers().forEach(function(layer){ if(layer instanceof ol.layer.Vector){ var features =

How to prevent feature clicks through popup?

我的未来我决定 提交于 2019-12-11 13:34:57
问题 I need a popup to be opened when clicking on the features of a vector layer. I used the Vector Icon Example as starting point. My problem is that when a feature is covered by the popup, you can still click it (Fiddle-Demo: click the lower point and you can click the upper one through the popup). How can prevent this behavior? Relevant code: map.on('click', function(evt) { var element = popup.getElement(); $(element).popover({ "placement": "top", "html": true }); var popover = $(element).data(

Dynamically adding and removing segments from a track in OpenLayers 3

纵然是瞬间 提交于 2019-12-11 13:18:21
问题 I want to display a track in real-time with OpenLayers 3 which disolves at the end, just like a snails trail. Only appending new coordinates to a LineString is easy. See this example. But removing coordinates from the end of the line does not seem to be supported by the API. How should I go about that? Is extending the LineString class the only option? Or should I use a separate feature for each line segment? Update : I used this code with ol-debug.js. But get/setFlatCoordinates is not

Geoserver - filtering points using DWITHIN

前提是你 提交于 2019-12-11 11:29:07
问题 First of all I am new to Geoserver and Openlayers. I have been trying to get this working on the Geoserver side using the Layer preview page to view my layer using the Openlayer viewer. I would be implementing it as an Openlayers WFS GET request in the end. What I am trying to accomplish is to return features that are within a certain distance of different points. (ie. within 5km of a school) I am using the Layer preview page on Geoserver . I have added the CQL filter of "DWITHIN(GEOM, POINT(

openlayers 3 , clustering polygons or linestings

ぃ、小莉子 提交于 2019-12-11 10:54:09
问题 i've been searching for a way to cluster polygons using openlayers 3 but no luck. i've read that clustering only works with points so i'm thinking about editing the ol.source.cluster . so had anyone done it, or got any other solutions? Kind regards 回答1: As of openlayers 3.15.0, it is possible to cluster all geometry types using an optional function, geometryFunction . From http://openlayers.org/en/v3.15.0/apidoc/ol.source.Cluster.html: Function that takes an ol.Feature as argument and returns

Change maxZoom option in runtime to ol.View in Openlayers 3

大憨熊 提交于 2019-12-11 10:48:11
问题 Im trying to change the maxZoom option once a functionality of the map is activated. So it has to be during runtime so it can be rolled back to the original maxZoom. Creating the ol.View you configure this parameters like this: new ol.View({ ... zoom: 10, maxZoom: 17, minZoom: 10, }); however, the api only allows to change zoom with setZoom() 回答1: You can accomplish this by changing the view of the map completely: map.setView(new ol.View({ zoom: 10, maxZoom: 17, minZoom: 10, })); Edit: A

How to draw linestring from consecutive points of array in openlayers

杀马特。学长 韩版系。学妹 提交于 2019-12-11 10:42:16
问题 I am trying to draw LineString in openlayers with consecutive Points to give it a feel of animation like it is drawing from start to end. I tried to achieve it by following this example. All references of OL2 are converted to OpenLayers 5, but still drawing should happen one point followed by next for entire array and not at once. Find my code with current output here - my code. [For reference] This is I am trying to achieve Snake animation for leaflet. 回答1: Using only the vertices of a

OpenLayers 3 Defining axis ordering

我与影子孤独终老i 提交于 2019-12-11 10:16:30
问题 I run into a problem that my GeoJSON return coordinates in a latitude/longitude order, but OpenLayers wants them to be in reversed order: longitude/latitude. And I cant't get them another way from server. Is it possible to reverse coordinates using OL3, like I found something about old OL like this formatOptions: { xy: false } Does something like this available in OL3? 回答1: The short answer is no. OL3 only accepts XY. If you have the possibility to reverse it in your GeoJSON source, do that.

ol3 with IE11 in a c# webbrowser control mouse click events not working

[亡魂溺海] 提交于 2019-12-11 10:11:53
问题 I've "upgraded" to IE 11 for the browser inside a c# application using the webbrowser control. When I load my web page into the IE 11 browser natively everything works properly on the map. When I'm in the c# application everything loads without error except that I can not click on the map and drag it. All of my map click events will also not fire. I can use the arrow keys to move the map, and the wheel mouse also works. I have noticed that when I use IE 11 natively, and use the developer