dojoConfig = {
    async: true,
    parseOnLoad: true,
    packages: [{
        name: 'tdlib',
        location: this.location.pathname.replace(/\/[^/]+$/, "") + "/js/tdlib"
    }]
};
var map;
var startExtent;
var baseLayer, imageLayer, annolayer;
require([
	"esri/map",
	"esri/graphic",
	"esri/InfoTemplate",
	"esri/layers/GraphicsLayer",
	"esri/layers/ArcGISTiledMapServiceLayer",
	"esri/dijit/Scalebar",
	"dojo/parser",
	"dijit/layout/BorderContainer",
	"dijit/layout/ContentPane",
	"esri/symbols/PictureMarkerSymbol",
	"esri/symbols/SimpleMarkerSymbol",
	"esri/geometry/Point",
	"esri/geometry/Circle",
	"esri/symbols/Font",
	"esri/symbols/TextSymbol",
	"esri/SpatialReference",
	"dojo/domReady!",
	"dojo/dom-construct",
	"esri/dijit/InfoWindow",
	"esri/dijit/PopupTemplate",
	"esri/toolbars/draw",
	"esri/symbols/SimpleLineSymbol",
	"esri/Color",
	"esri/symbols/PictureFillSymbol",
	"esri/symbols/SimpleFillSymbol"
	], function(Map, Graphic,InfoTemplate, GraphicsLayer, tiled, Scalebar, parser, PictureMarkerSymbol, SimpleMarkerSymbol, Point, Circle, Font, TextSymbol, SpatialReference, domConstruct, InfoWindow,PopupTemplate,Draw,SimpleLineSymbol,Color,PictureFillSymbol,SimpleFillSymbol) {

		var map = new esri.Map("map");
		//var my=new esri.layers.ArcGISTiledMapServiceLayer("http://192.168.2.214:6080/arcgis/rest/services/JiaXing_YX/MapServer");
	var my=new esri.layers.ArcGISTiledMapServiceLayer("http://61.155.110.210:7008/mapurl/earth_image_geodetic/MapServer");
	map.addLayer(my);
		
		var cameraGraphicsLayer = new esri.layers.GraphicsLayer({
			id: "camera"
		});
		var roadGraphicsLayer = new esri.layers.GraphicsLayer({
			id: "road"
		});
		map.addLayer(cameraGraphicsLayer);
		map.addLayer(roadGraphicsLayer);
		MapAPI.setPictureMarkerSymbol(esri.symbol.PictureMarkerSymbol);
		MapAPI.setInfoTemplate(esri.InfoTemplate);
		MapAPI.setInfoWindow(esri.dijit.InfoWindow);
		MapAPI.setPopupTemplate(esri.dijit.PopupTemplate);
		MapAPI.setGraphic(esri.Graphic);
		MapAPI.setMap(map);
		MapAPI.setGraphicsLayer(cameraGraphicsLayer);
		MapAPI.setPoint(esri.geometry.Point);
		MapAPI.setDraw(esri.toolbars.Draw);
		MapAPI.setSimpleLineSymbol(esri.symbol.SimpleLineSymbol);
		MapAPI.setPictureFillSymbol(esri.symbol.PictureFillSymbol);
		MapAPI.setColor(esri.Color);
		MapAPI.setSimpleFillSymbol(esri.symbol.SimpleFillSymbol);
		console.log("map",MapAPI.getMap());
		// 加载所以相机 并打点
		$.ajax({
			type:'post',
			dataType : 'json',
			url : 'sbtdspsrAction!query_Sbtdspsr.do',
//			url:'szMapHttpAction!getMapGridData.do',
//			data : {"layerSeq":"1","page":1,"rows":10000},
			success:function(res){				
				res.forEach(function(item){

					
				 	var param = {'tdmc':item.tdmc,'tdtypename':item.tdtypename,'sbbh':item.sbbh,
				 				 'tdbh':item.tdbh,'sfzlx':item.sfzlx,'sfzx':item.sfzx,
				 				 'jd':item.jd,'wd':item.wd};
					var str=JSON.stringify(param);
	
					var html="<div class='bcontent'><div><span style='color:#75767A'>"+item.tdmc+"</span></div><ul  class='bcontentItem'><li onclick='MapMain.realtimeVideo("+str+")'>实时视频</li><li onclick='MapMain.artificialAlarm("+str+")'>人工告警</li><li onclick=' MapMain.detailInformation("+str+")'>详细信息</li></ul></div>";

					MapUtil.addPoint(item,html);
				});			
				
	//			map.centerAt([res[0].jd,res[0].wd]);      // 点位居中
			}
		})
});
