AnsweredAssumed Answered

GMAPS - mapExtension.addToMap - rendering polygons with holes

Question asked by geonetadmin on Jun 15, 2010
Latest reply on Jul 14, 2010 by nliu
Original User: brownsm

There apppears to be a problem with the mapExtension class when using mapExtension.addMap to add a polygon that contains a hole. Attachment poly1.jpg shows how the displayed polygon should look and attachment poly2.jpg shows how the polygon is renedered using the following code. The image overlay from the ArcGIS Server Map service displays the polygon correctly (attachment poly3.jpg). Does anyone have a solution?

<html debug=true>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Find Task:  Add FindResults with default styling</title>

    <script src="" type="text/javascript"></script>
    <script src="" type="text/javascript" ></script>

    <script type="text/javascript">

      var gmap = null;
      var findTask = null;
      var params = null;
      var mapExtension = null;
      var gOverlays = null;

      function initialize() {
        // GMap construction
        gmap = new GMap2(document.getElementById('gmap'));
        gmap.addControl(new GLargeMapControl());
        gmap.addControl(new GMapTypeControl());
        gmap.setCenter(new GLatLng(-22.5886, 117.1802), 11);

        //Create MapExtension utility class
        mapExtension = new esri.arcgis.gmaps.MapExtension(gmap);

         // Find Task
        findTask = new esri.arcgis.gmaps.FindTask("http://pergis33/sdidev2/rest/services/Title_Information_Tiled/MapServer");

        // You can execute a task and listen for the complete event or use the callback to get the results
        GEvent.addListener(findTask, "executecomplete", function() {
          //console.debug("'find task complete' event fired!!!");

        // Find Parameters
        params = new esri.arcgis.gmaps.FindParameters();
        params.layerIds = [1,2];
        params.searchFields = ["FMT_TENID"];

      function executeFind(searchText) {
        // clear map overlays and event listeners using MapExtension removeFromMap

        // set find parameters
        params.searchText = searchText;

        // execute find task
        findTask.execute(params, findCompleteCallback);


      function findCompleteCallback(findResults) {
        // add the findresutls to google map without any style
        gOverlays = mapExtension.addToMap(findResults);



  <body onload="initialize();" onunload="GUnload();">
  <table width="100%" height="100%">
      <td align="center">

          <tr align="left">
              Search Formatted TenID:  <input type="text" id="searchString" value="" size="10"/><input id="executeFind" type="button" value="Execute Find" onclick="executeFind(document.getElementById('searchString').value);" /> 

              <input id="clear" type="button" value="Clear Map Overlays" onclick="mapExtension.removeFromMap(gOverlays);" />

          <tr align="left" valign="top">
              <div id="gmap" style="width: 500px; height:500px;"></div>