polygon

How delete vertex (node) on Polygon with Hole (Google Maps V3)

让人想犯罪 __ 提交于 2019-12-02 07:14:02
问题 I have taken this example (solution) from Ian Grainger, but I added a Polygon with inner hole. This example work fine for outer vertex path, but not for inner vertex path. I need implement event Listener for internal and external node, because on fire event on internal vertex, delete external vertex. It doesn't work well. Can someone provide some sample on how to solve this issue? 回答1: One of your issues is polygon with a hole in it has multiple (in this case two) paths, and you aren't adding

Programmatically drawing polygons on a map by joining the outermost markers

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-02 06:11:34
I have a sample map layer in this fiddle where the map layer is drawn using fusion table as, var Layer = new google.maps.FusionTablesLayer({ query: { select: 'lat', from: '1BLPDF4n0sW0i0BfD9Yo0DqbshyTH1s5Iuu_1IeU' }, map: map, suppressInfoWindows: true }); How can I draw a polygon programmatically by joining the outermost markers in the map so that if someone add new marker and if it is falling outside the drawn polygon then automatically the polygon should redraw to include the newly added marker too. You want to do a Convex Hull of your points. Example using the Google Maps API v3 on a

Google Maps - Create a polygon around existing markers

心不动则不痛 提交于 2019-12-02 06:09:37
问题 I dont know if this is possible but I use a google map to plot out positions of entities via markers on an overlay. I would like to be able to create a polygon or some other sort of overlay object around all the created markers, highlighting the extent of the markers, sort of a catchment area diagram. I wont know before all the markers are retrieved from the database and mapped what the extent is. Anyone have any ideas how to approach this..? Thanks 回答1: I think you are looking for the Convex

Add multiple Polygon objects on the same JPanel frame

Deadly 提交于 2019-12-02 05:46:40
问题 So I have a DrawStar class that draws a star using Polygon like that: public void paintComponent(Graphics g) { Graphics2D g2 = (Graphics2D) g; int[] cX = new int[] {x, x+5, x+20, x+8, x+16, x, x-16, x-8, x-20, x-5, x}; int[] cY = new int[] {y, y+14, y+14, y+22, y+39, y+29, y+39, y+22, y+14, y+14, y}; Polygon pol = new Polygon(cX, cY, 11); g2.setColor(this.color); g2.draw(pol); g2.fillPolygon(pol); } Then in my main class I create a JPanel frame to draw the stars: ... JFrame starsframe = new

Finding Top Left and Bottom Right Points (C++)

青春壹個敷衍的年華 提交于 2019-12-02 05:34:11
I'm looking for some help with a project I'm working on. What I'm doing is a polygon approximation algorithm. I've got all of the points of my boundary, but in order to start the algorithm, I need to find the top left and bottom right points from the set of points. All of the points are stored in a structure array that has the x and y coordinates of each point. Any ideas on an easy way to loop through the array of points? Any help would be greatly appreciated. If you need more information, just ask and I'll provide all I can. Based on your comment that bottom left is min(x+y) and top right is

How can I connect two parallel 2d polygons to create a seamless 3d mesh?

北城余情 提交于 2019-12-02 05:25:00
问题 Suppose I have two polygons, one just above the other like this: I'd like to connect up their vertices to create a 3d mesh out of triangles around their perimeters. This picture shows one way you might do this (orange lines represent triangle edges): This sort of thing can be done intuitively by a human, but I'm having real trouble translating it into a working algorithm. The polygons are stored as a List<Vector2> . They will always be simple, and may be concave. 回答1: I would do it like this:

How delete vertex (node) on Polygon with Hole (Google Maps V3)

本秂侑毒 提交于 2019-12-02 04:55:01
I have taken this example (solution) from Ian Grainger , but I added a Polygon with inner hole. This example work fine for outer vertex path, but not for inner vertex path. I need implement event Listener for internal and external node, because on fire event on internal vertex, delete external vertex. It doesn't work well. Can someone provide some sample on how to solve this issue? One of your issues is polygon with a hole in it has multiple (in this case two) paths, and you aren't adding listeners for changes on both paths. Below is a proof of concept, it isn't perfect, sometimes markers are

Chrome: Bug with SVG polygon animation?

僤鯓⒐⒋嵵緔 提交于 2019-12-02 04:41:19
I created recently a hangman SVG graphic with animations, you can find it here: http://ykg-clan.de/svg/test/hangman_old.svg This works perfectly in Firefox - but in Chrome, the polygons and polylines do not get animated correctly. I've done this by setting the points on invisible first and then animating them to the desired position. Firefox seems to recognize that I wish that x x,y y,z z must become to a a,b b,c c because of the order of the coordinates. However, chrome does not get it. How can I realize the animated polygon just as I did here but also working in chrome? Thank you for help!

FillPolygon with holes

时光总嘲笑我的痴心妄想 提交于 2019-12-02 03:44:14
I want to create a "fill" that fills the inside of a polygon, created using a point list, but be able to remove its holes. My old code: Private Sub DrawSomething(ByVal points as List(of Point), _ ByVal myBrush As System.Drawing.Brush, _ ByVal myGraphics As System.Drawing.Graphics) myGraphics.FillPolygon(myBrush, points) End Sub It simply fills a polygon created by the contour of the points in the list. How can I fill the polygon, but exclude the holes in it (which I know are inside, I have tested): Private Sub DrawSomething(ByVal points as List(of Point), _ ByVal holes as List(of List(of Point

drawPolygon keeps drawing lines from starting (mousePressed) location to current (mouseDragged) location

橙三吉。 提交于 2019-12-02 03:19:37
So, I'm trying to dynamically draw a Polygon starting from when I click the mouse until I stop dragging and release. Instead of, for the purpose of this question, a square outline being drawn when I click, drag down, then right-across, then up, then left-across, this is what happens: http://imgur.com/t8ZN3Pp Any suggestions? Notes: model.addPolygon() creates a Polygon with starting points and adds it to an ArrayList called 'polys' model.addPolygonPoint() adds points to this created polygon that is stored in 'polys' my paint function iterates through polys to paint public void mousePressed