Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

overview map - static image from ol screenshot #1061

Open
andreaordonselli opened this issue May 16, 2024 · 1 comment
Open

overview map - static image from ol screenshot #1061

andreaordonselli opened this issue May 16, 2024 · 1 comment
Labels

Comments

@andreaordonselli
Copy link

Good morning,
would it be possible to dynamically generate a screen of the map on the fly with the default layers turned on and position it in the ImageStatic of Overview control?

                        var maxMapExtent = map.getView().getProperties().extent;
			var ov = new ol.control.Overview({
			  layers: [ 
				new ol.layer.Image({
					source: new ol.source.ImageStatic({
						url: './resources/minimap.png',
						imageExtent: maxMapExtent,
					})
				})
			  ],
			  rotation: true,
			  align: 'bottom-left',
			  //panAnimation: "elastic" 
			});
			map.addControl(ov);	
			// Select button
			var overviewbuttontitle = $('div.ol-overview button');
			// Set button title
			overviewbuttontitle.attr('title', 'Minimap');
@Viglino
Copy link
Owner

Viglino commented May 16, 2024

You can use the Print control to get an image of the map and place it whre you want.
See https://viglino.github.io/ol-ext/examples/canvas/map.control.print.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants