Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [mapcanvas]

The tag has no usage guidance.

0
votes
0answers
13 views

Vector Layer | Shape Source not showing on map canvas

I am trying to open a shapefile in the QGIS 3.4.4 version but for some reason the layer is not showing in the map canvas. I have tried the drag and drop approach as well as opening from Layer -> ...
0
votes
0answers
129 views

Increasing size/height of OpenLayers map/canvas?

I'm trying to let the Map/Canvas height of OpenLayers 100%, but I'm not able to do it. I've already tried putting in several places the "height: 100%;" and used the "map.updateSize()" function, but ...
2
votes
1answer
38 views

Unable to delete certain elements from my map

Can anyone help me get rid of these 2 boxes ? I can't figure out how they showed up in the first place... I've remove the check marks next to all my layers and the boxes won't go away. I'm getting ...
1
vote
1answer
220 views

Get QgsLayoutItemMap from existing QPT Layout

I created a QPT model with a map inside QGIS. The problem is when I try to select the map under pyQGIS : qpt = QDomDocument() qpt.setContent(content) layout = QgsLayout(QgsProject().instance()) ...
1
vote
0answers
218 views

Add OpenLayers map on map canvas with PyQGIS

I have map canvas with two shapesfiles, and I want to add OSM map behind. My code for this is: from PyQt5.QtGui import * from PyQt5.QtWidgets import QHBoxLayout, QDockWidget, QWidget from osgeo ...
0
votes
1answer
128 views

How to set 2 vector layers into map canvas, pyqgis 3.0

I have 2 shapefiles which I need to lap. The first one is city grid, and the second one representing borders of the city. Anyway, my code is: extent = QgsRectangle() layers = [] QgsProject.instance()...
-1
votes
2answers
333 views

Export Map Error from OpenLayers 3 in Chrome?

Im using this js file to export map in Openlayers 3 in Google Chrome but i'm getting en error saying that Uncaught DOMException: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases ...
2
votes
1answer
519 views

Use a second canvas for drawing an animation in Openlayers

I want to implement an animation of flowing rivers on top of an Openlayers map. My doubts are if I simply should make a new canvas and position it on top of the map or if there is a more elegant way ...
12
votes
1answer
304 views

Displaying generated lines out of map extent using QGIS?

I have drawn an OD flow map using QGIS geometry generator, using the following expression : make_line( centroid( $geometry ), centroid( geometry( get_feature( 'Layer2', 'Attribute1', attribute( ...
1
vote
0answers
271 views

Implementing 'Add feature' functionality programmatically to QGIS?

I have a script that is adapted from the book Menke - Mastering QGIS and used to draw a polygon directly on the map canvas. Now I want to expand upon that script and mirror the 'add feature' ...
8
votes
1answer
199 views

Accessing QGIS map canvas as a variable for expressions

Is it possible to access the QGIS Map Canvas as a variable or expression value to be used in the field calculator or labelling engine? (i.e. so that you can create an expression that selects/...
2
votes
0answers
263 views

Label only one polygon in canvas/map view per category/value in attribute table

Question: In QGIS (2.18), how do you show only one label per field of view in the map canvas for each visible category (that is displayed in the map view/canvas at any given scale/focus) of a multi-...
4
votes
1answer
236 views

Recursive loop to modify vector layer and refresh mapcanvas

I'm trying to plot one point "jumping" each second in the canvas (like a gps tracking). I need to take points from a .csv file. This functionality is made in a QWidget of my application, so the code ...
4
votes
1answer
842 views

How to set QGIS map canvas size programmatically

I need my map canvas to be exactly 1920x1080. So the Save as image would save a png exactly this size. I've tried setting it with iface.mapCanvas.resize(QSize(1920,1080)) But no luck, resize() ...
0
votes
1answer
562 views

How to determine when the map has finished rendering

I have written a few functions to compare QGIS performance to MapInfo. Most of them involve doing some analysis then dumping the results on the map, as such the process would be considered 'finished' ...
2
votes
1answer
1k views

Dynamically move map canvas and main window using PyQGIS

I am trying to create plugin that will open new window with some layer, Dynamically "pan" my window, when main window is pan. So boundingbox coordinates should be the same in both windows. I need new ...
5
votes
1answer
1k views

How to get attribute values from vector features visible in the qgis canvas

I have a vector layer (grid). Currently I select some tiles with the select tool and paste some python code to get information about these features. layer = qgis.utils.iface.activeLayer() ...
1
vote
0answers
123 views

Qgis python: no interaction with Map Canvas

I've created a simple python script to load and show two layers and zoom to the first one. It looks like the script doesn't run the last 4 lines after I uncomment'print lyr1'. Anyway the map canvas is ...
2
votes
3answers
3k views

How to refresh MapCanvas while PyQGIS-script is running?

I try to write a PyQGIS script similar to this: Use of python console to prepare offline map from WMS (tile downloader). Basically there are two loops to pan the mapCanvas, refresh the mapCanvas and ...
4
votes
1answer
636 views

How can I optimize layer filtering using setSubsetString or QgsFeatureRequest().setFilterFids(my_indexes)

i'm developping a plugin (under QGis 2.8.1) for traffic assignment where I want to show the results of my simulation at each time step. Right now I'm using Time Manager plugin but it gets very slow ...
1
vote
0answers
74 views

Mapcanvas not showing layers features

usually when i load an osm file with lots of features (>10000) the qgis will go not responding, when the files loaded, layers will show up, but not the features on the map canvas, its just blank ...
2
votes
1answer
575 views

zooming map in QGIS map canvas without changing the scale

I use QGIS to create maps mainly for printing in scale 1:100.000 to 1:25.000. It would be great, if the map in the canvas could be zoomed without changing the scale of the canvas. The only way to get "...
1
vote
1answer
611 views

Add a canvas on the map that can pan and zoom along with it

I want to know if it's possible to add a canvas on a ArcGIS map that can pan and zoom along with it. The reason I ask that it's because we have different workflows where we have a lot of entities (+...
2
votes
1answer
51 views

the renderering of mapcanvas is still active

i am working with qgis c++ api 2.8.2 and qt4.8.5 i want to disable the rendering during zoom in or zoom out fonction in order to have a fast zoom i try to use : MyMapCanvas->stopRendering(); and ...
4
votes
1answer
823 views

Drawing polygon in QGIS map canvas

I want to make a custom application which includes an option just like the "Select Features by Polygon" feature in the QGIS. I am able to draw the polygon using following code: self.rb = ...
2
votes
0answers
261 views

Map canvas saveAsImage() method saves wrong image in QGIS

I've been trying to write a small python script to output 2 tif's based on given box extents. The script all works, box coordinates convert to project coordinates, zooms to right place (would like ...
1
vote
1answer
749 views

OpenLayers 3 WMS layer to canvas

I am taking the context and taking it to a canvas which was asked here and the answer can be found in this JSfiddle example. However, I am looking to load a WMS layer from geoserver and extract only ...
1
vote
1answer
437 views

How to re-render only a single layer on a mapcanvas?

In my application I have a mapcanvas that contains several layers. some of layers need to be updated or rendered again because data has been changed ( like the geometry or some attributes ) Is there ...
0
votes
1answer
162 views

How can i catch clicked signal on a qgsmapcanvas

I am working under c++ with the qgis API 2.8 In order to make different operation on a canvas like personnalized rotation or selecting a region for zooming, I had to catch different signal like ...
2
votes
0answers
403 views

PyQGIS Set Extent for loaded layers - Refresh problem

I've written a plugin which loads a number of map layers (based on constraints) and I would then like to set the canvas extent to a selection of them. Code very similar to that below works perfectly, ...
1
vote
0answers
117 views

How to set QGIS mapCanvas to exact values

My QGIS 2.8.2 standalone app's mapCanvas fills a central widget with a fixed quadratic size x=y=1000 pixels. When I set the mapCanvas extent() to an area defined quadratic as well given by a ...