title: union of googlemaps polygons with clipper.js
body: <p>I'm trying to merge 2  polygons (green) on Google maps (API v3 Javascript) with clipper.js.</p>
  
  <p>before : <a href="http://jsfiddle.net/kevdiho/tc53Y/" rel="nofollow">http://jsfiddle.net/kevdiho/tc53Y/</a></p>
  
  <p>My goal is to have only 1 polygon (red). The problem is that the final polygon is not exactly follow the path and sometime it's even worst.</p>
  
  <p>after : <a href="http://jsfiddle.net/kevdiho/uF6ec/" rel="nofollow">http://jsfiddle.net/kevdiho/uF6ec/</a></p>
  
  <p>to merge the 2 green polygons i used clipper.js and this function ClipperLib.ClipType.ctUnion</p>
  
  <pre><code>var clipType = ClipperLib.ClipType.ctUnion;
  function mergePolygon()
    {
        for(j=0;j&lt;array_polygon.length;j++){
            array_polygon_clipper = createarray_clipper_polygon(array_polygon[j]);
            subj_polygons.push(array_polygon_clipper);
        }
        cpr.AddPolygons(subj_polygons, ClipperLib.PolyType.ptSubject);
        var succeeded = cpr.Execute(clipType, solution_polygons);
        return solution_polygons;
    }
  </code></pre>
  
  <p>How can i solve this problem?
   Clipper.js is a good answer or there are other libraries to work with googlemaps polygons?</p>