function AddPolygonGraphics(Points1, gname, GDesc) { Points1 = "[" + Points1 + "]" var polygon1 = new Polygon(new SpatialReference({ wkid: 4326 })); //polygon1.addRing([[58.4245719470205, 23.582511030118049], [58.423799470824214, 23.594545845196812],[58.44002147094627, 23.5743298721676], [58.443798021239232, 23.578735174416867], [58.4245719470205, 23.582511030118049]]); polygon1.addRing(Points1); // alert(polygon1.rings[0].length); // map is in web mercator so transform the geometry var poly_wm = webMercatorUtils.geographicToWebMercator(polygon1); var symbol = new SimpleFillSymbol(); var strhotspot = (gname.trim()); if (GDesc != "") { strhotspot = strhotspot + "," + (GDesc.trim()); } var infoTemplate = new InfoTemplate(); infoTemplate.content = strhotspot; var graphic = new Graphic(poly_wm, symbol); graphic.setInfoTemplate(infoTemplate); MyGraphicsLayerGL.add(graphic); mapDiv.style.visibility = "visible"; DivesriLogoImage.style.visibility = "hidden"; } |