Skip to content

Tag: openlayers

Convert bbox coordinates to geoJSON

Hello I have a array of coordinates that look something like this: [14.540536348680394,65.03068471588048,18.945463651319603,66.82731528411952] I need to properly display it on my openlayers map but it seems like I must convert the bbox to a valid geoJSON object first. Is there a fuction I can write or a library that can do this for me? Or is there any work arounds

Openlayers delete element option by mouse rightclick

I would like to enable the delete option after right-clicking on my object. So far, the code I provided doesn’t work, because the browser is checking some devices for me, as you can see below: My code looks like this: I would like to have an option to delete the selected object after the right-click. How can I do it?

Different layer styles affecting each other openlayers

I want to draw dashed line and straight line by using open layers Draw method. In this method there is a LineString option for drawing straight line but I cound not find a option for dashed line. So my aim is to style LineString and make a dashed line. But the problem is, this approach is also affecting the straight

Filter features with properties in OpenLayers

I’d like to filter features on the map using the feature properties. For example if I have this property in the geojson: And I want to see only featuers with Start > 10, how can I implement that features with Start < 10 are hidden? If I change the style with following code the features are transparent but they are

Openlayers 4 Adding Animation Pause/Continue Functionality?

I am using open layers 4. I am moving and stoping marker animation as this example without any problem. But I want to add pause and continue functionality to marker also. I edit some variables and endeavor on the issue with these functions. When I call continueAnimation function at first, the elapsedTime parameter become negative and give exception on moveFeature

How to show zoom level on openlayers (js/html file only)?

looking for some help on this. I know it is something along the lines of Looking to add a div for the zoom status also: or what would be the best approach? If someone could offer some insight, it would be appreciated. Couldn’t find the answer in the documentation. Answer I don’t believe in the current version of openlayers that