/**
 *获取全省或者全北京市地图数据，地图层级中第一级的数据
 */
function getFullMapData(pNode,node) {
    var genJson={};
    var url=getMapUrl(pNode);
    if(pNode===node){
        $.ajax({
            type:"GET",
            async: false,
            url:url,
            dataType:"json",
            success:function (data) {
                genJson=data;
            }
        })
    }else{
        //根据url截取出函数名
        var functionName=url.substring(url.lastIndexOf("/")+1,url.lastIndexOf(".json"));
        $.ajax({
            type:"GET",
            async: false,
            url:url,
            dataType:"json",
            success:function (data) {
                var i=eval(functionName+"('"+node+"')");
                var geo=data.features[i];
                if(geo===undefined){
                    genJson=null;
                }else{
                    data.features=[];
                    data.features[0]=geo;
                    genJson=data;
                }
                genJson=data;
            }
        })
    }
    return genJson;
}

//根据数据框获取地图信息
function getMapUrl(areaName) {
    switch (areaName){
        case "全国":
            return '/pqs9000/json/map/china.json';
        case "北京市":
            return '/pqs9000/json/map/beijing.json';
        case "江苏省":
            return '/pqs9000/json/map/jiangsu.json';
        case "四川省":
            return '/pqs9000/json/map/sichuan.json';
        case "海南省":
            return '/pqs9000/json/map/hainan.json';
        case "浙江省":
            return '/pqs9000/json/map/zhejiang.json';
        case "福建省":
            return '/pqs9000/json/map/fujian.json';
        case "湖南省":
            return '/pqs9000/json/map/hunan.json';
        case "河北省":
            return '/pqs9000/json/map/hebei.json';
        case "苏州市":
            return '/pqs9000/json/map/suzhou.json';
        case "杭州市":
            return '/pqs9000/json/map/hangzhou.json';
        case "冀北":
            return '/pqs9000/json/map/jibei.json';
        case "海宁市":
            return '/pqs9000/json/map/haining.json';
        default:
            return '/pqs9000/json/map/china.json';
    }
}

//根据二级地名返回需要获取该区域json的关键字----》江苏
function jiangsu(areaName) {
    switch (areaName){
        case "盐城市":
            return 0;
        case "徐州市":
            return 1;
        case "南通市":
            return 2;
        case "淮安市":
            return 3;
        case "苏州市":
            return 4;
        case "宿迁市":
            return 5;
        case "连云港市":
            return 6;
        case "扬州市":
            return 7;
        case "南京市":
            return 8;
        case "泰州市":
            return 9;
        case "无锡市":
            return 10;
        case "常州市":
            return 11;
        case "镇江市":
            return 12;
    }
}

//根据二级地名返回需要获取该区域json的关键字----》冀北
function jibei(areaName) {
    switch (areaName){
        case "承德市":
            return 0;
        case "张家口市":
            return 1;
        case "唐山市":
            return 2;
        case "秦皇岛市":
            return 3;
        case "廊坊市":
            return 4;
    }
}


//根据二级地名返回需要获取该区域json的关键字----》苏州
function suzhou(areaName) {
    switch (areaName){
        case "常熟市":
            return 0;
    }
}

//根据二级地名返回需要获取该区域json的关键字----》湖南
function hunan(areaName) {
    switch (areaName){
        case "邵阳市":
            return 2;
    }
}

//根据二级地名返回需要获取该区域json的关键字----》浙江
function zhejiang(areaName) {
    switch (areaName){
        case "丽水市":
            return 0;
        case "杭州市":
            return 1;
        case "温州市":
            return 2;
        case "宁波市":
            return 3;
        case "舟山市":
            return 4;
        case "台州市":
            return 5;
        case "金华市":
            return 6;
        case "衢州市":
            return 7;
        case "绍兴市":
            return 8;
        case "嘉兴市":
            return 9;
        case "湖州市":
            return 10;
    }
}

//根据二级地名返回需要获取该区域json的关键字----》杭州
function hangzhou(areaName) {
    switch (areaName){
        case "萧山":
            return 11;
    }
}

//根据二级地名返回需要获取该区域json的关键字----》海南
function hainan(areaName) {
    switch (areaName){
        case "儋州市":
            return 0;
        case "文昌市":
            return 1;
        case "乐东县":
            return 2;
        case "三亚市":
            return 3;
        case "琼中县":
            return 4;
        case "东方市":
            return 5;
        case "海口市":
            return 6;
        case "万宁市":
            return 7;
        case "澄迈县":
            return 8;
        case "白沙县":
            return 9;
        case "琼海市":
            return 10;
        case "昌江县":
            return 11;
        case "临高县":
            return 12;
        case "陵水县":
            return 13;
        case "屯昌县":
            return 14;
        case "定安县":
            return 15;
        case "保亭县":
            return 16;
        case "五指山市":
            return 17;
    }
}

//根据二级地名返回需要获取该区域json的关键字----》北京
function beijing(areaName) {
    switch (areaName){
        case "密云县":
            return 0;
        case "怀柔":
            return 1;
        case "房山":
            return 2;
        case "延庆县":
            return 3;
        case "门头沟":
            return 4;
        case "昌平":
            return 5;
        case "大兴":
            return 6;
        case "顺义":
            return 7;
        case "平谷":
            return 8;
        case "通州":
            return 9;
        case "朝阳":
            return 10;
        case "海淀":
            return 11;
        case "丰台":
            return 12;
        case "石景山":
            return 13;
        case "西城":
            return 14;
        case "东城":
            return 15;
        case "宣武":
            return 16;
        case "崇文":
            return 17;
    }
}

//根据二级地名返回需要获取该区域json的关键字----》四川
function sichuan(areaName) {
    switch (areaName){
        case "甘孜":
            return 0;
        case "阿坝":
            return 1;
        case "凉山":
            return 2;
        case "绵阳市":
            return 3;
        case "达州市":
            return 4;
        case "广元市":
            return 5;
        case "雅安市":
            return 6;
        case "宜宾市":
            return 7;
        case "乐山市":
            return 8;
        case "南充市":
            return 9;
        case "巴中市":
            return 10;
        case "泸州市":
            return 11;
        case "成都市":
            return 12;
        case "资阳市":
            return 13;
        case "攀枝花市":
            return 14;
        case "眉山市":
            return 15;
        case "广安市":
            return 16;
        case "德阳市":
            return 17;
        case "内江市":
            return 18;
        case "遂宁市":
            return 19;
        case "自贡市":
            return 20;
        case "天府新区":
            return 21;
    }
}


//根据二级地名返回需要获取该区域json的关键字----》福建
function fujian(areaName) {
    switch (areaName){
        case "南平市":
            return 0;
        case "三明市":
            return 1;
        case "龙岩市":
            return 2;
        case "宁德市":
            return 3;
        case "福州市":
            return 4;
        case "漳州市":
            return 5;
        case "泉州市":
            return 6;
        case "莆田市":
            return 7;
        case "厦门市":
            return 8;
    }
}

//根据二级地名返回需要获取该区域json的关键字----》海宁
function haining(areaName) {
    switch (areaName){
        case "尖山站":
            return 0;
        case "换流站":
            return 13;
    }
}


//根据二级地名返回需要获取该区域json的关键字----》河北省
function hebei(areaName) {
    switch (areaName){
        case "承德市":
            return 0;
        case "张家口市":
            return 1;
        case "保定市":
            return 2;
        case "唐山市":
            return 3;
        case "沧州市":
            return 4;
        case "石家庄市":
            return 5;
        case "邢台市":
            return 6;
        case "邯郸市":
            return 7;
        case "秦皇岛市":
            return 8;
        case "衡水市":
            return 9;
        case "廊坊市":
            return 10;
    }
}