earthoutreach / earth-api-utility-library

Automatically exported from code.google.com/p/earth-api-utility-library
0 stars 0 forks source link

Draw polygon doesn't quite track the mouse #40

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Looking at the poly draw example that is available here and trying to 
implement. 
(http://earth-api-utility-library.googlecode.com/svn/trunk/extensions/examples/p
oly-draw.html)

As I click to drop each point and move the mouse around the marker doesn't 
quite track the mouse. The work around was to turn off bounce in the 
drawLineString method, which isn't obvious.

Basically modified the code to the following and it works

    function drawMousePolygon() {
        gex.dom.clearFeatures();
        var placemark = gex.dom.addPolygonPlacemark([],{
            style: {
                line: { width: 2, color: '#ff0' },
                poly: { color: '8000ffff' }
            }
        });
        gex.edit.drawLineString(placemark.getGeometry().getOuterBoundary(), { bounce: false });
}

Original issue reported on code.google.com by chaitany...@roames.com.au on 19 Apr 2012 at 6:13