<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ReadJosn.aspx.cs" Inherits="ReadJosn" %>
<!doctype html>
<html>
<head>
<title>...</title>
<link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.2/js/dojo/dijit/themes/claro/claro.css">
<script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.2"></script>
<script type="text/javascript" language="Javascript">
dojo.require("esri.map");
dojo.require("esri.layers.FeatureLayer");
dojo.require("esri.layers.graphics");
var map;
function init() {
//var startExtent = new esri.geometry.Extent({ "xmin": -12505511, "ymin": 2230016, "xmax": -3699965, "ymax": 8100380, "spatialReference": { "wkid": 102100 } });
map = new esri.Map("mapDiv");
//create and add new layer
var layer = new esri.layers.ArcGISTiledMapServiceLayer("");
var sketchLayer = "";
map.addLayer(layer);
var jsonFS =
{ "geometry": { "rings": [[[663791.8729519134, 2760558.7151297885], [663791.8729519134, 2760492.5691641634], [667099.1712331766, 2749776.9227328706], [656118.9409393826, 2749247.7550078686], [652547.0587956184, 2755994.6435016454], [663791.8729519134, 2760558.7151297885]]], "spatialReference": { "wkid": 32638, "latestWkid": 32638 } }, "symbol": { "color": [0, 0, 0, 64], "outline": { "color": [0, 0, 0, 255], "width": 1, "type": "esriSLS", "style": "esriSLSSolid" }, "type": "esriSFS", "style": "esriSFSSolid" } }
;
// var temp = eval("(" + jsonFS + ")");
//var sk = new esri.Graphic(eval("(" + jsonFS + ")"));
alert("0");
map.getLayer("sketchLayer").add(new esri.Graphic(eval("(" + jsonFS + ")")));
map.addLayer(new esri.Graphic(eval("(" + jsonFS + ")")));
alert("addLayer" + sk);
//console.log(jsonFS.features);
//var fs = new esri.tasks.FeatureSet(jsonFS);
//var featureCollection = {
// layerDefinition: {
// "geometryType": "esriGeometryPoint",
// "fields": [
// {
// }
// ]
// },
// featureSet: fs
//};
//var jsonfl = new esri.layers.FeatureLayer(featureCollection, {
// mode: esri.layers.FeatureLayer.MODE_SNAPSHOT,
// 'id': 'jsonfl'
//});
//map.addLayer(jsonfl);
}
dojo.ready(init);
</script>
</head>
<body class="claro">
<div id="mapDiv" style="width: 900px; height: 600px; border: 1px solid #000;"></div>
</body>
</html>
no Graphic appear to map any idea ??? Help