Questions tagged [openlayers-6]

v6 specific questions on the OpenLayers mapping library

OpenLayers v6 is the latest release of the OpenLayers mapping library.

412 questions
2
votes
2 answers

How to add layerswitcher in openlayer 6.4.3

How to add layerswitcher in ol 6. import 'ol/ol.css'; import {Map, View} from 'ol'; import TileLayer from 'ol/layer/Tile'; import OSM from 'ol/source/OSM'; import XYZ from 'ol/source/XYZ'; const map = new Map({ target: 'map', layers: [ …
Adithya
  • 1,687
  • 3
  • 19
  • 34
2
votes
0 answers

OpenLayers with OpenStreetMap Data Extracts (.oms)

Since I'm new with OpenLayer I wanted to ask if it is possible to use the OpenStreetMap data extracted in the .oms format as the data source for the OpenLayer for offline usage, I checked the OpenLayer API documentation and was unable to find the…
2
votes
0 answers

Openlayers Map Click Event not getting called in ReactJS

Problem: OpenLayers(v6.3) MAP is visible in REACTJS(16.13) but click event on MAP is not getting called. Purpose: I want to place a marker and handle its click event to show some POPUP with data. Code: Code included is though self explanatory; here…
u tyagi
  • 732
  • 9
  • 18
2
votes
3 answers

I can't display the KML

I am taking my first steps in openlayers, I find it quite interesting, but based on a simple example to show OSM it has been impossible for me to add a layer with a KML file and show it together. I understand that I am close to achieving it and that…
2
votes
1 answer

Is it a bug for getFeaturesAtPixel(pixel, opt_options)?

When I used this function to get features, I found that: If the 'Style' (like image and text) of a 'Feature' is within 100 pixels of the feature's coordinate, I can get the feature by using the pixels within the 'Style'; But If the 'Style' is too…
Choc_Liu
  • 41
  • 4
2
votes
2 answers

No Interactions working in OpenLayers 6 with Angular 9

I'm trying to setup an OpenLayers 6 Map in an Angular 9 component. I can successfully load the OSM source and the controls are working, but Interactions like dragging the map or zooming with the mouse wheel don't work. Manually adding the default…
2
votes
1 answer

OpenLayers increase or decrease extent by a percentage

I have a map that has features on it and when I zoom to those features the user has the ability to set a preference as to the zoom buffer. I'm not sure if there is a built-in way of doing this in OL...I've looked at the documentation but couldn't…
Funn_Bobby
  • 647
  • 1
  • 20
  • 57
2
votes
1 answer

How can I set max zoom available on a tile server?

Question: Let's say my tile server has only tile images for zooms 8, 9, and 10. When the client starts with zoom 11, I want Openlayers to fetch zoom 10 (maximum available zoom on the server) and stretch the tile in the client. So, I want the user to…
sina
  • 960
  • 2
  • 8
  • 20
2
votes
0 answers

Using decluttering in OpenLayers6 when displaying multiple labels for a line feature

Goal: I am trying to display two labels for a line using OpenLayers 6.2 (one above the line, and one below the line) while the decluttering feature is turned on. Picture of target state with decluttering on. Problem: When decluttering is turned…
dannym
  • 21
  • 3
2
votes
1 answer

My map won't move with openlayers 6.2 and angular 9, even with DragRotateAndZoom interaction

I'm trying to create a map, and as I can see on other sites and examples, everyone can move their map with mouseclick and drag. But my map wont move at all, anyone have idea what I did wrong? These are the components.ts and the component.html files…
2
votes
1 answer

How can you set the extent of a XYZ source using OpenLayers 6?

I have a map with a background layer of Europe and another ( XYZ ) layer displaying a much smaller area. How can I avoid the 404 error message from the XYZ layer for tiles that don't exist? I have tried to pass: extent:…
2
votes
1 answer

Displaying view issue after adding bootstrap 4 in openlayers

I'm developing a webGIS map with Openlayers 6. It contains many widgets and modules I write myself. everything was fine until I added Bootstrap 4 to my project. After adding Bootstrap 4 (it's fine with Bootstrap 3!) the view does not display…
Mahdi Mahmoodian
  • 473
  • 2
  • 13
1
vote
0 answers

OpenLayers TileLayer Extent issues on an infinitely panning map

Apologies in advance, this is my first StackOverflow question. I need to use an OpenLayers layer extent to place a boundary on a region of the map in order to prevent an XYZSource's url from trying to grab tiles that don't exist (resulting in 404…
jeffdbx
  • 11
  • 2
1
vote
1 answer

Adding marker on Openlayers Map using React

I want to add the marker on the Openlayer map using React on the center point but I am not able to do so, I tried different solutions but still no luck. Here is my React code: import React, { useState, useEffect, useRef } from "react"; import { Map,…
1
vote
1 answer

Openlayers: Is there a map event that fires when a new layer has been added?

I am searching for a event that fires when a new layer has been added to an openlayers map. Sth like map.on('layeradded')... I found all of these events:…
nerdess
  • 10,051
  • 10
  • 45
  • 55
1 2
3
27 28