Open mattbbernstein opened 9 years ago
Hi -
I'm glad that you've found the library useful so far.
Thanks.
On Wed, Jul 8, 2015 at 12:29 PM, mattbbernstein notifications@github.com wrote:
First off, this library is excellent. It's exactly what I've been looking for for my application. However I'm experiencing some unexpected behavior and I'm not sure if it's working as intended or it's a bug.
1.
I create a PolygonObject by clicking a few places on the map and saving the longitude/latitude as points in a QVector then creating a QPolygonF from that vector and finally building a PolygonObject from that polygon. I know the points are being saved correctly since once it paints it's painting the vertices in the correct places, my issue is that it's not just filling the polygon, it's filling the entire map. And on top of this, the fill behavior gets really wonky if the angles become too acute or if I try to draw something like a chevron. 2.
Is there anyway to force it to repaint immediately? If I'm zoomed in at like level 10, once I draw an object, I have to zoom out for it to draw, otherwise it doesn't display. Once it's drawn I have no trouble and it scales correctly, but in order to get it to populate I need to zoom out
Thanks again!
— Reply to this email directly or view it on GitHub https://github.com/raptorswing/MapGraphics/issues/18.
So I'm using QT 5.5 on Windows 7.
So I edited my code so that when I click on the map I store a point and display a circle. Once I double click, It draws lines and then creates a PolygonObject. The new issue is that 1. it only draws the polygon once I've zoomed out to about level 2 or 3 and 2. the fill is bounded and the right shape but only fits at zoom level 17 (2nd to last) even if I draw in a different level.
Picture 1: 4 Points have chosen and a PolygonObject has been created but isnt filled in
Picture 2: I've zoomed out to about level 4 or 5 and the fill first appears
Picture 3: Zoomed back into my original view. The fill size stays the same so I think there is an issue with the coordinates or zoom invariance
Picture 4: Zoom level 17, the only time the fill fits the polygon
Code section called everytime a point is clicked on the map (when drawing is enabled):
"window" inherits MapGraphicsView so I could use the mouse handlers getCurrentPoint() retrieves the most recent click (stored on click in the handler). The mouse location ( event->locPos() ) is parsed through mapToScene() to translate the local mouse position to (longitude, latitude)
Code section called upon double click and finishing the shape
Draws the connecting edge, creates a PolygonObject and then adds both to the scene.
Thanks for the help!
First off, this library is excellent. It's exactly what I've been looking for for my application. However I'm experiencing some unexpected behavior and I'm not sure if it's working as intended or it's a bug.
Thanks again!