0
for(var i = 0; i < jsonIncident.length; i++)
{
    var x = jsonIncident[i].Latitude        
    var y = jsonIncident[i].Longitude 

    //I can only retreive lat and lon for the image position
    //However to add an image i need it to be in x and y format.


    var type = jsonIncident[i].IncidentType
    var time = jsonIncident[i].MyDate
    var loc = jsonIncident[i].MyDate
    var desc = jsonIncident[i].Description
    var image

    //This where you add the image

    var incident = new esri.Graphic({ "geometry": { "x": x, "y": y,
        "spatialReference": { "wkid": 3414 }
        }, "attributes": { "Title": type,
        "Time": time, "Location": loc, "Description": desc, } });

        incident.setSymbol(image);
        incident.setInfoTemplate(infoTemplate);
        map.graphics.add(incident);

}

map.infoWindow.resize(320, 130);
4

1 回答 1

0

我相信您可以使用投影或地理坐标系创建图形。请参阅http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/arcgis/help/jshelp_start.htm#jshelp/inside_graphics.htm

于 2012-07-19T01:25:25.617 回答