question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Initially expanded OverviewMap is blank

See original GitHub issue

Describe the bug Using openlayer 4.6.5

When the map is displayed with an initially expanded (collapsed: false) OverviewMap control added, the overview map is blank and is it only shows the layer after it is collapsed and then expanded again.

var overviewMap = new ol.control.OverviewMap({
	  collapsed: false.
	  layers: new ol.layer.Tile({
		source: new ol.source.OSM()
             	}),
	  view: new ol.View(),
});
map.addControl(overviewMap);

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
agiudiceandreacommented, Mar 16, 2019

Thanks @ahocevar. As you can see in the previously linked code snippets, the command to set the map view extent (generated by the QGIS/qgis2web plugin) is in fact:

map.getView().fit([666205.581372, 4548772.644111, 671179.853857, 4552155.819337], map.getSize());

It works fine if it’s executed before the control is added to the map

map.getView().fit([666205.581372, 4548772.644111, 671179.853857, 4552155.819337], map.getSize());
map.addControl(overviewMap);

but not if it’s executed after the control is added to the map

map.addControl(overviewMap);
map.getView().fit([666205.581372, 4548772.644111, 671179.853857, 4552155.819337], map.getSize());
0reactions
stale[bot]commented, May 22, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

OpenLayers v7.2.2 API - Class: Map
Works only if a projection is used that can be wrapped. Returns: The detected features or an empty array if none were found....
Read more >
MapView | API Reference | ArcGIS Maps SDK for JavaScript ...
You can set the initial extent (or visible portion of the map) by using either a combination of center and scale or zoom,...
Read more >
Node Group Maps - ITOM Practitioner Portal - Micro Focus
The Network Overview map in the Topology Maps workspace is similar to the Initial Discovery Progress map with the following exceptions:.
Read more >
Global Enhanced GEOINT Delivery (G-EGD) User Guide
The overview map in the bottom right corner of the screen shows your current location on the globe at ... By default, thumbnails...
Read more >
Maps JavaScript API Release Notes - Google Developers
Maps that are created within the page's initial viewport should see no ... Removes a non-allowed aria-expanded attribute from a default map type...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found