openlayers-5

Scaling the icon-image size to an absolute value

佐手、 提交于 2021-01-29 17:18:17
问题 I'm developing an application where one functionality is displaying a device on a map using open-layers. These devices can be added by the user and they all can have a custom icon-image using an uploaded image. This image can also be changed on runtime depending on some of the devices attributes (for example the temperature). From what i understood reading through their documentation, there are some properties on the ol.style.Icon object like imgSize which is are all cutting, but not scaling

how to get which lineString is get clicked on click on any parallel line generated from Style geometry in Openlayer

99封情书 提交于 2021-01-28 18:57:48
问题 I have generated parallel lineString on map by using Style geometry options for Single Feature Object in openlayer v5.2 with different-different width stroke after modified the found reference link on http://jsfiddle.net/CPRam/egn1kmc8/. While using geometry with call function in style function I'm not getting the geometry on single click event for the Style. So for that, I removed call function and given fixed resolution with distance for parallel. So now on 'singleclick' event, I'm able to

Using angular 7 universal with Openlayers 5

蹲街弑〆低调 提交于 2021-01-28 13:48:06
问题 I've got an angular 7.2 app using open layers 5.3. I'm trying to set up angular universal for this app, but when I run the universal server ( node dist/server.js ), I got some errors due to client only variables not being defined, such as window . webpack:///./node_modules/ol/has.js?:54 var DEVICE_PIXEL_RATIO = window.devicePixelRatio || 1; ^ ReferenceError: window is not defined I tried using domino to mock these variables, but it just fails with another error, because of a canvas element

Draw great circle line on the map directly in OpenLayers 5?

你说的曾经没有我的故事 提交于 2020-08-26 11:39:37
问题 Is it possible to draw the great circle line in the OpenLayers 5 directly, without splitting the LineString into many small parts like https://openlayers.org/en/latest/examples/flight-animation.html? Here is the problem of user experience related to the usage of the great circle line. The Modify Feature(https://openlayers.org/en/latest/examples/modify-test.html?q=Test) is provided. The number of the editable points in the great circle line is more than that in the direct line. The user have

popup with multiple points features

£可爱£侵袭症+ 提交于 2020-01-30 12:55:10
问题 i'm having some troubles with open layer 5 looking/coping this example https://openlayers.org/en/latest/examples/icon.html?q=marker having more than one "clickable icon" if i click and open the popup is ok, then if i click the map (not icons) the popup goes away, well! but if i've a popover opened on the first icon, and then i click another one icon, the ballon move up the next, but the content is not changed... where i'm wrong!? thanks 回答1: You need to destroy the old popup before creating a

Wait until openlayers 5 geolocation returned a value

北慕城南 提交于 2020-01-05 05:26:26
问题 I am using openlayers 5 to implement a simple geolocation functionality : When check the geolocation checkbox, the geolocation starts, zooms to the position with an animated transition and it automatically tracks the position constantly. It adds a feature in a vector layer. When uncheck the geolocation checkbox, the geolocation is turned off, along with the tracking and that vector layer is cleared. My problem is that I don't know how to wait until the geolocation has a value , so I can

How to get the extent of a GPX file to display it on a map (using openalyers)

女生的网名这么多〃 提交于 2020-01-03 05:54:10
问题 I am working on the GPX source example of openlayers 5.x available at https://openlayers.org/en/latest/examples/gpx.html I am able to successfully load my GPX file and to display it on a map, but I have been unable to get its extent to know the min/max latitudes and longitudes to fit it dynamically on the map. This is my code (identical to the example): var GpxVector = new VectorLayer({ source: new VectorSource({ url: 'https://host.domain.com/filename.gpx', format: new GPX(), }), style:

OpenLayers 5: move marker smoothly

社会主义新天地 提交于 2020-01-03 05:08:51
问题 I use https://openlayers.org/en/latest/examples/feature-move-animation.html code snippet: // This long string is placed here due to jsFiddle limitations. // It is usually loaded with AJAX. var polyline = [ 'hldhx@lnau`BCG_EaC??cFjAwDjF??uBlKMd@}@z@??aC^yk@z_@se@b[wFdE??wFfE}N', 'fIoGxB_I\\gG}@eHoCyTmPqGaBaHOoD\\??yVrGotA|N??o[N_STiwAtEmHGeHcAkiA}^', 'aMyBiHOkFNoI`CcVvM??gG^gF_@iJwC??eCcA]OoL}DwFyCaCgCcCwDcGwHsSoX??wI_E', 'kUFmq@hBiOqBgTwS??iYse@gYq\\cp@ce@{vA}s@csJqaE}{@iRaqE{lBeRoIwd@_T{]_',

Interactive features in vector layers in openlayers 5

拟墨画扇 提交于 2019-12-25 18:12:22
问题 I am using openlayers 5.1.3 and I confused as to how to create the functionality of clicking on a feature of a vector layer, get exactly the one I clicked and then get its properties. I am following this example that is the only relevant I found. I have an empty vector source that gets GeoJSON data after search initialize the map and the vector this.vectorsource = new VectorSource({}); this.vectorlayer = new VectorLayer({ source: this.vectorsource }); var selectClick = new Select({ condition:

Openlayers: shared views side by side…how to properly unbind them?

允我心安 提交于 2019-12-25 03:18:24
问题 I have used an adjusted version of the shared views example from openlayers.org: https://openlayers.org/en/latest/examples/side-by-side.html var layer = new TileLayer({ source: new OSM() }); window['view1'] = new ol.View({ center: [0, 0], zoom: 1 }); window['view2'] = new ol.View({ center: [0, 0], zoom: 1 }); window['map1'] = new ol.Map ({ target: 'map1', layers: [layer], view: window['view1'] }); window['map2'] = new ol.Map({ target: 'map2', layers: [layer], view: window['view2'] }); window[