123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299 |
- var disProvince1 = new AMap.DistrictLayer.Province({
- zIndex:14,
- adcode:'110000',
- deep:2,
- styles:{
- polygon:{
- fillColor:'#122442'
- },
- polyline:{
- strokeColor:function(properties){
- var type = properties.type;
- switch(type){
- case 'Province_Border_China':return '#406795'//中国省界
- case 'Province_Border_Foreign': return 'cornflowerblue';//外国省界
- case 'City_Border_China': return '#122442';//中国地级市边界
- case 'County_Border_China': return '#122442';//中国区县边界
- }
- }
- }
- }
- });
- var disProvince2 = new AMap.DistrictLayer.Province({
- zIndex:14,
- adcode:'120000',
- deep:2,
- styles:{
- polygon:{
- fillColor:'#122442'
- },
- polyline:{
- strokeColor:function(properties){
- var type = properties.type;
- switch(type){
- case 'Province_Border_China':return '#406795'//中国省界
- case 'Province_Border_Foreign': return 'cornflowerblue';//外国省界
- case 'City_Border_China': return '#122442';//中国地级市边界
- case 'County_Border_China': return '#122442';//中国区县边界
- }
- }
- }
- }
- });
- var disProvince3 = new AMap.DistrictLayer.Province({
- zIndex:14,
- adcode:'130000',
- deep:2,
- styles:{
- polygon:{
- fillColor:'#122442'
- },
- polyline:{
- strokeColor:function(properties){
- var type = properties.type;
- switch(type){
- case 'Province_Border_China':return '#406795'//中国省界
- case 'Province_Border_Foreign': return 'cornflowerblue';//外国省界
- case 'City_Border_China': return '#122442';//中国地级市边界
- case 'County_Border_China': return '#122442';//中国区县边界
- }
- }
- }
- }
- });
- var disProvince4 = new AMap.DistrictLayer.Province({
- zIndex:14,
- adcode:'150000',
- deep:2,
- styles:{
- polygon:{
- fillColor:'#122442'
- },
- polyline:{
- strokeColor:function(properties){
- var type = properties.type;
- switch(type){
- case 'Province_Border_China':return '#406795'//中国省界
- case 'Province_Border_Foreign': return 'cornflowerblue';//外国省界
- case 'City_Border_China': return '#122442';//中国地级市边界
- case 'County_Border_China': return '#122442';//中国区县边界
- }
- }
- }
- }
- });
- var disProvince5 = new AMap.DistrictLayer.Province({
- zIndex:14,
- adcode:'640000',
- deep:2,
- styles:{
- polygon:{
- fillColor:'#122442'
- },
- polyline:{
- strokeColor:function(properties){
- var type = properties.type;
- switch(type){
- case 'Province_Border_China':return '#406795'//中国省界
- case 'Province_Border_Foreign': return 'cornflowerblue';//外国省界
- case 'City_Border_China': return '#122442';//中国地级市边界
- case 'County_Border_China': return '#122442';//中国区县边界
- }
- }
- }
- }
- });
- var disProvince6 = new AMap.DistrictLayer.Province({
- zIndex:14,
- adcode:'610000',
- deep:2,
- styles:{
- polygon:{
- fillColor:'#122442'
- },
- polyline:{
- strokeColor:function(properties){
- var type = properties.type;
- switch(type){
- case 'Province_Border_China':return '#406795'//中国省界
- case 'Province_Border_Foreign': return 'cornflowerblue';//外国省界
- case 'City_Border_China': return '#122442';//中国地级市边界
- case 'County_Border_China': return '#122442';//中国区县边界
- }
- }
- }
- }
- });
- var disProvince7 = new AMap.DistrictLayer.Province({
- zIndex:14,
- adcode:'620000',
- deep:2,
- styles:{
- polygon:{
- fillColor:'#122442'
- },
- polyline:{
- strokeColor:function(properties){
- var type = properties.type;
- switch(type){
- case 'Province_Border_China':return '#406795'//中国省界
- case 'Province_Border_Foreign': return 'cornflowerblue';//外国省界
- case 'City_Border_China': return '#122442';//中国地级市边界
- case 'County_Border_China': return '#122442';//中国区县边界
- }
- }
- }
- }
- });
- var disProvince8 = new AMap.DistrictLayer.Province({
- zIndex:14,
- adcode:'410000',
- deep:2,
- styles:{
- polygon:{
- fillColor:'#122442'
- },
- polyline:{
- strokeColor:function(properties){
- var type = properties.type;
- switch(type){
- case 'Province_Border_China':return '#406795'//中国省界
- case 'Province_Border_Foreign': return 'cornflowerblue';//外国省界
- case 'City_Border_China': return '#122442';//中国地级市边界
- case 'County_Border_China': return '#122442';//中国区县边界
- }
- }
- }
- }
- });
- var disProvince9 = new AMap.DistrictLayer.Province({
- zIndex:14,
- adcode:'370000',
- deep:2,
- styles:{
- polygon:{
- fillColor:'#122442'
- },
- polyline:{
- strokeColor:function(properties){
- var type = properties.type;
- switch(type){
- case 'Province_Border_China':return '#406795'//中国省界
- case 'Province_Border_Foreign': return 'cornflowerblue';//外国省界
- case 'City_Border_China': return '#122442';//中国地级市边界
- case 'County_Border_China': return '#122442';//中国区县边界
- }
- }
- }
- }
- });
- var disProvince10 = new AMap.DistrictLayer.Province({
- zIndex:14,
- adcode:'320000',
- deep:2,
- styles:{
- polygon:{
- fillColor:'#122442'
- },
- polyline:{
- strokeColor:function(properties){
- var type = properties.type;
- switch(type){
- case 'Province_Border_China':return '#406795'//中国省界
- case 'Province_Border_Foreign': return 'cornflowerblue';//外国省界
- case 'City_Border_China': return '#122442';//中国地级市边界
- case 'County_Border_China': return '#122442';//中国区县边界
- }
- }
- }
- }
- });
- var disProvince11 = new AMap.DistrictLayer.Province({
- zIndex:14,
- adcode:'340000',
- deep:2,
- styles:{
- polygon:{
- fillColor:'#122442'
- },
- polyline:{
- strokeColor:function(properties){
- var type = properties.type;
- switch(type){
- case 'Province_Border_China':return '#406795'//中国省界
- case 'Province_Border_Foreign': return 'cornflowerblue';//外国省界
- case 'City_Border_China': return '#122442';//中国地级市边界
- case 'County_Border_China': return '#122442';//中国区县边界
- }
- }
- }
- }
- });
- var disProvince12 = new AMap.DistrictLayer.Province({
- zIndex:14,
- adcode:'210000',
- deep:2,
- styles:{
- polygon:{
- fillColor:'#122442'
- },
- polyline:{
- strokeColor:function(properties){
- var type = properties.type;
- switch(type){
- case 'Province_Border_China':return '#406795'//中国省界
- case 'Province_Border_Foreign': return 'cornflowerblue';//外国省界
- case 'City_Border_China': return '#122442';//中国地级市边界
- case 'County_Border_China': return '#122442';//中国区县边界
- }
- }
- }
- }
- });
- var map = new AMap.Map('container', {
- resizeEnable: true,
- zoom:6,
- zooms:[6,18],
- center: [112.47485,37.789585]
- });
- map.setMapStyle('amap://styles/87fc86ed648cae752d097a75f4744133');
- map.add(disProvince1);
- map.add(disProvince2);
- map.add(disProvince3);
- map.add(disProvince4);
- map.add(disProvince5);
- map.add(disProvince6);
- map.add(disProvince7);
- map.add(disProvince8);
- map.add(disProvince9);
- map.add(disProvince10);
- map.add(disProvince11);
- map.add(disProvince12);
- var trafficLayer = new AMap.TileLayer.Traffic({
- zIndex: 10
- });
- trafficLayer.setMap(map);
|