WME MMR China 7-2-2015 Overlay

Creates polygons for MapRaid groups in a WME "MMR China 7-2-2015 Groups" layer

// ==UserScript==
// @name                WME MMR China 7-2-2015 Overlay
// @namespace           https://greasyfork.org/users/5252
// @description         Creates polygons for MapRaid groups in a WME "MMR China 7-2-2015 Groups" layer
// @include             https://www.waze.com/editor/*
// @include             https://www.waze.com/*/editor/*
// @include             https://editor-beta.waze.com/*
// @version             1.8
// @grant               none
// @copyright           2014 davielde
// ==/UserScript==


//---------------------------------------------------------------------------------------


//generated by rickzabel's overlay generator

//RZ RaidName will be replaced by the name of the layer in your KML file
//RZ RaidNameNoSpaces will be replaced by the name of the layer in your KML file
//RZ AreaPoints will be replaced by the names, colors, and area points from your KML file

setTimeout(InitMapRaidOverlay, 1000);

function AddRaidPolygon(raidLayer,groupPoints,groupColor,groupNumber){
    
    var mro_Map = Waze.map;
    var mro_OL = OpenLayers;
    var raidGroupLabel = 'Raid Group ' + groupNumber;
    var groupName = 'RaidGroup' + groupNumber;
    
    var style = {
        strokeColor: groupColor,
        strokeOpacity: .8,
        strokeWidth: 3,
        fillColor: groupColor,
        fillOpacity: 0.15,
        label: raidGroupLabel,
        labelOutlineColor: "black",
        labelOutlineWidth: 3,
        fontSize: 14,
        fontColor: groupColor,
        fontOpacity: .85,
        fontWeight: "bold"  
    };
    
    var attributes = {
        name: groupName,
        number: groupNumber
    };
    
    var pnt= [];
    for(i=0;i<groupPoints.length;i++){
        convPoint = new OpenLayers.Geometry.Point(groupPoints[i].lon,groupPoints[i].lat).transform(new OpenLayers.Projection("EPSG:4326"), mro_Map.getProjectionObject());
        //console.log('MapRaid: ' + JSON.stringify(groupPoints[i]) + ', ' + groupPoints[i].lon + ', ' + groupPoints[i].lat);
        pnt.push(convPoint);
    }
		       
    var ring = new mro_OL.Geometry.LinearRing(pnt);
    var polygon = new mro_OL.Geometry.Polygon([ring]);
    
    var feature = new mro_OL.Feature.Vector(polygon,attributes,style);
    raidLayer.addFeatures([feature]);

}

function CurrentRaidLocation(raid_mapLayer){
    var mro_Map = Waze.map;

    for(i=0;i<raid_mapLayer.features.length;i++){
        var raidMapCenter = mro_Map.getCenter();
        var raidCenterPoint = new OpenLayers.Geometry.Point(raidMapCenter.lon,raidMapCenter.lat);
        var raidCenterCheck = raid_mapLayer.features[i].geometry.components[0].containsPoint(raidCenterPoint);
        //console.log('MapRaid: ' + raid_mapLayer.features[i].attributes.number + ': ' + raidCenterCheck);
        if(raidCenterCheck === true){
        	var raidLocationLabel = 'Raid Group ' + raid_mapLayer.features[i].attributes.number + ' - ' + $('.WazeControlLocationInfo').text();
    		//setTimeout(function(){$('.WazeControlLocationInfo').text(raidLocationLabel);},200);
			setTimeout(function(){$('.WazeControlLocationInfo').text(raidLocationLabel);},50);
			var str = $('.WazeControlLocationInfo').text();
			
			var n2 = str.indexOf(" - ");
			
			if(n2 > 0){
				var n = str.length;
				var res = str.substring(n2+2, n);
				var rescount = res.indexOf(" - ");
				if(rescount>0){
					var n3 = res.length;
					var res2 = res.substring(rescount+2, n3);
						
				}
				var raidLocationLabel = 'Raid Group ' + raid_mapLayer.features[i].attributes.number + ' - ' + res2;
			} else {
				var raidLocationLabel = 'Raid Group ' + raid_mapLayer.features[i].attributes.number + ' - ' + $('.WazeControlLocationInfo').text();
			}	
    		setTimeout(function(){$('.WazeControlLocationInfo').text(raidLocationLabel);},200);
		}
    }
}

function InitMapRaidOverlay(){

    var mro_Map = Waze.map;
    var mro_OL = OpenLayers;

    //if (!mro_Map) return;
	
    //if (!mro_OL) return;

    var mro_mapLayers = mro_Map.getLayersBy("uniqueName","__MMRChina7-2-2015");
        
    var raid_mapLayer = new mro_OL.Layer.Vector("MMR China 7-2-2015", {
        displayInLayerSwitcher: true,
        uniqueName: "__MMRChina7-2-2015"
    });
        
    I18n.translations.en.layers.name["__MMRChina7-2-2015"] = "MMR China 7-2-2015";
    mro_Map.addLayer(raid_mapLayer);
    raid_mapLayer.setVisibility(true);
    

var V01Guangdong = [{lon:'110.821592',lat:'21.319122999999998'},{lon:'112.823208',lat:'21.518955'},{lon:'114.38708',lat:'22.016477'},{lon:'116.624377',lat:'22.950464000000004'},{lon:'119.696045',lat:'24.856534'},{lon:'115.686035',lat:'27.205786'},{lon:'113.965064',lat:'25.403534000000004'},{lon:'113.67279',lat:'25.334097'},{lon:'113.297659',lat:'25.484731'},{lon:'112.80554',lat:'25.314662'},{lon:'112.987347',lat:'25.187029000000003'},{lon:'112.999444',lat:'24.941092'},{lon:'112.837464',lat:'24.900523999999997'},{lon:'112.759089',lat:'25.062553'},{lon:'112.404905',lat:'25.171775999999998'},{lon:'112.227717',lat:'25.190429'},{lon:'112.15720500000002',lat:'25.151712000000003'},{lon:'112.16531400000001',lat:'24.849098999999995'},{lon:'111.970198',lat:'24.723895'},{lon:'111.75293',lat:'24.056497'},{lon:'111.269531',lat:'23.574056999999996'},{lon:'111.30249',lat:'22.998851999999996'},{lon:'109.412842',lat:'21.596151'},{lon:'109.676514',lat:'20.262196999999997'},{lon:'108.369141',lat:'19.435514'},{lon:'108.46801800000001',lat:'18.396229999999996'},{lon:'109.819336',lat:'17.853290000000005'},{lon:'111.203613',lat:'19.445874'},{lon:'110.821592',lat:'21.319122999999998'}];
AddRaidPolygon(raid_mapLayer, V01Guangdong,"#4186F0","01 - Guangdong");

var V02Henan = [{lon:'102.747211',lat:'34.172146'},{lon:'107.804671',lat:'32.070367'},{lon:'109.204102',lat:'31.653381'},{lon:'110.972636',lat:'30.940051'},{lon:'113.61772',lat:'29.819575'},{lon:'114.98009599999999',lat:'31.476169'},{lon:'115.37208000000001',lat:'31.409638999999995'},{lon:'115.908483',lat:'31.80038700000001'},{lon:'115.856358',lat:'32.498381'},{lon:'115.214388',lat:'32.593523000000005'},{lon:'115.35462100000001',lat:'33.47608100000001'},{lon:'115.64872200000002',lat:'33.60727'},{lon:'116.209972',lat:'33.70923100000001'},{lon:'116.676089',lat:'33.919744'},{lon:'116.55044500000001',lat:'34.273488'},{lon:'116.16468199999998',lat:'34.411390999999995'},{lon:'111.75293',lat:'35.281501'},{lon:'102.747211',lat:'34.172146'}];
AddRaidPolygon(raid_mapLayer, V02Henan,"#7C3592","02 - Henan");

var V03Shandong = [{lon:'114.43359400000001',lat:'34.777716'},{lon:'116.16468199999998',lat:'34.411390999999995'},{lon:'116.372837',lat:'34.665622'},{lon:'116.409876',lat:'34.829485000000005'},{lon:'116.524184',lat:'34.926798'},{lon:'116.829729',lat:'34.93085'},{lon:'117.01812699999999',lat:'34.802528'},{lon:'117.269804',lat:'34.570739'},{lon:'117.503855',lat:'34.48514899999999'},{lon:'117.591342',lat:'34.475707'},{lon:'117.73400099999999',lat:'34.550149'},{lon:'117.799982',lat:'34.65617'},{lon:'118.09783499999999',lat:'34.655415'},{lon:'118.09568499999999',lat:'34.568419'},{lon:'118.17880799999999',lat:'34.419442'},{lon:'118.33101000000002',lat:'34.414732'},{lon:'118.40177500000001',lat:'34.47189'},{lon:'118.47840400000001',lat:'34.657728'},{lon:'118.611246',lat:'34.709459'},{lon:'118.768704',lat:'34.721018'},{lon:'118.772783',lat:'34.814772'},{lon:'118.90564300000001',lat:'35.041626'},{lon:'119.03961200000002',lat:'35.059229'},{lon:'119.182036',lat:'35.110883'},{lon:'119.278564',lat:'35.128894'},{lon:'119.301779',lat:'35.076589'},{lon:'119.421387',lat:'35.077213'},{lon:'122.816162',lat:'36.949892'},{lon:'122.816162',lat:'37.544577'},{lon:'121.986694',lat:'37.679472999999994'},{lon:'121.26709000000001',lat:'37.696861'},{lon:'120.85510200000002',lat:'38.043765'},{lon:'120.541992',lat:'38.00914800000001'},{lon:'117.883959',lat:'38.265791'},{lon:'117.762478',lat:'38.124356000000006'},{lon:'117.566721',lat:'38.058032'},{lon:'117.441102',lat:'37.867997'},{lon:'116.81211199999998',lat:'37.811988'},{lon:'116.426601',lat:'37.483014'},{lon:'116.38238800000002',lat:'37.562835'},{lon:'116.298535',lat:'37.566563'},{lon:'116.286021',lat:'37.477221'},{lon:'116.239111',lat:'37.481403'},{lon:'116.23786299999999',lat:'37.367661'},{lon:'116.013771',lat:'37.35958500000001'},{lon:'115.68224200000002',lat:'36.816143000000004'},{lon:'115.220352',lat:'36.22339600000001'},{lon:'114.43359400000001',lat:'34.777716'}];
AddRaidPolygon(raid_mapLayer, V03Shandong,"#F8971B","03 - Shandong");

var V04Sichuan = [{lon:'102.747211',lat:'34.172146'},{lon:'102.029663',lat:'33.985565'},{lon:'102.442724',lat:'33.500586999999996'},{lon:'101.226813',lat:'33.12447499999999'},{lon:'100.907913',lat:'32.64586'},{lon:'99.88998',lat:'33.049188'},{lon:'98.620608',lat:'33.837043'},{lon:'97.502424',lat:'33.976096999999996'},{lon:'97.141113',lat:'32.731841'},{lon:'98.892668',lat:'30.764418000000003'},{lon:'98.986816',lat:'27.839075999999995'},{lon:'101.381836',lat:'25.661334'},{lon:'104.940665',lat:'27.205465'},{lon:'106.423916',lat:'27.80222'},{lon:'110.972636',lat:'30.940051'},{lon:'109.204102',lat:'31.653381'},{lon:'107.804671',lat:'32.070367'},{lon:'102.747211',lat:'34.172146'}];
AddRaidPolygon(raid_mapLayer, V04Sichuan,"#4186F0","04 - Sichuan");

var V05Jiangsu = [{lon:'117.007588',lat:'34.81644200000001'},{lon:'116.829729',lat:'34.93085'},{lon:'116.524184',lat:'34.926798'},{lon:'116.409876',lat:'34.829485000000005'},{lon:'116.372837',lat:'34.665622'},{lon:'116.92275799999999',lat:'34.397503'},{lon:'117.08595671544145',lat:'34.14421044316889'},{lon:'117.10091199999998',lat:'34.120913'},{lon:'117.21136572448845',lat:'34.11434301651251'},{lon:'117.245041',lat:'34.11232'},{lon:'117.27022100000002',lat:'34.100275'},{lon:'117.27022187533655',lat:'34.10027458112138'},{lon:'117.382053',lat:'34.046675'},{lon:'117.43784488806467',lat:'34.06002797323942'},{lon:'117.492714',lat:'34.073131'},{lon:'117.60448400000001',lat:'34.019754000000006'},{lon:'117.61059',lat:'34.01683299999999'},{lon:'117.74984',lat:'33.880949'},{lon:'117.72413',lat:'33.723202'},{lon:'118.163845',lat:'33.769542'},{lon:'118.16788500000001',lat:'33.705075'},{lon:'118.06218300000002',lat:'33.481866000000004'},{lon:'117.996936',lat:'33.361199'},{lon:'117.917435',lat:'33.237496'},{lon:'118.064858',lat:'33.118035'},{lon:'118.21060300000002',lat:'33.206279'},{lon:'118.23185500000001',lat:'33.15623'},{lon:'118.28033800000001',lat:'32.974608999999994'},{lon:'118.23301099999999',lat:'32.897254'},{lon:'118.33943000000001',lat:'32.756963'},{lon:'118.412913',lat:'32.726031'},{lon:'118.67314599999999',lat:'32.730646'},{lon:'118.74751900000001',lat:'32.731866'},{lon:'118.739873',lat:'32.830966'},{lon:'118.860738',lat:'32.95175'},{lon:'119.01091199999999',lat:'32.952075'},{lon:'119.13782500000002',lat:'32.841583'},{lon:'119.205169',lat:'32.713637'},{lon:'119.183883',lat:'32.585513'},{lon:'119.071866',lat:'32.497873'},{lon:'118.94811000000001',lat:'32.567440000000005'},{lon:'118.76726300000001',lat:'32.601811'},{lon:'118.673147',lat:'32.585893'},{lon:'118.673146489435',lat:'32.585893'},{lon:'118.57546000000002',lat:'32.569291'},{lon:'118.627773',lat:'32.484856'},{lon:'118.67314599999999',lat:'32.512962'},{lon:'118.6845',lat:'32.51998999999999'},{lon:'118.695741',lat:'32.408909'},{lon:'118.673147',lat:'32.290197'},{lon:'118.673146489435',lat:'32.290197'},{lon:'118.661062',lat:'32.226575'},{lon:'118.50740199999998',lat:'32.181271'},{lon:'118.50956399999998',lat:'32.112263'},{lon:'118.39397799999999',lat:'32.082559'},{lon:'118.386411',lat:'31.924009000000005'},{lon:'118.48153',lat:'31.797200000000004'},{lon:'118.527071',lat:'31.733095999999996'},{lon:'118.67017600000001',lat:'31.738101'},{lon:'118.67314599999999',lat:'31.697977000000005'},{lon:'118.673146489435',lat:'31.697970386400208'},{lon:'118.67793',lat:'31.633287'},{lon:'118.86770200000001',lat:'31.607717999999995'},{lon:'118.896471',lat:'31.486954999999995'},{lon:'118.723515',lat:'31.302359000000003'},{lon:'118.81014199999998',lat:'31.235904'},{lon:'119.096694',lat:'31.232919'},{lon:'119.361341',lat:'31.290391999999997'},{lon:'119.36737799999999',lat:'31.187267000000002'},{lon:'119.63742699999999',lat:'31.139739000000002'},{lon:'119.91996400000001',lat:'31.169948999999995'},{lon:'120.03165',lat:'31.025561999999994'},{lon:'120.19020800000001',lat:'30.933263'},{lon:'120.37317999999999',lat:'30.953182'},{lon:'120.490635',lat:'30.770570000000003'},{lon:'120.842584',lat:'30.980960000000007'},{lon:'120.939515',lat:'31.010280000000005'},{lon:'120.916901',lat:'31.081166'},{lon:'121.06100500000001',lat:'31.159924'},{lon:'121.048348',lat:'31.245282'},{lon:'121.15957499999999',lat:'31.282241'},{lon:'121.106604',lat:'31.357073'},{lon:'121.15213500000002',lat:'31.385643000000005'},{lon:'121.19487100000002',lat:'31.468904999999996'},{lon:'121.277441',lat:'31.483227999999997'},{lon:'121.35981',lat:'31.542891999999995'},{lon:'121.134773',lat:'31.781175000000005'},{lon:'121.180588',lat:'31.830578'},{lon:'121.278335',lat:'31.876148999999998'},{lon:'121.97026900000002',lat:'31.614954'},{lon:'121.973406',lat:'31.736907'},{lon:'121.888532',lat:'31.886876'},{lon:'121.620381',lat:'32.415274'},{lon:'121.14779099999998',lat:'32.601711'},{lon:'120.40192',lat:'34.265729'},{lon:'120.16839899999998',lat:'34.37835200000001'},{lon:'120.019445',lat:'34.436005'},{lon:'119.613046',lat:'34.593732'},{lon:'119.498586',lat:'34.68124'},{lon:'119.53375500000001',lat:'34.721297'},{lon:'119.50929',lat:'34.761903'},{lon:'119.45479399999999',lat:'34.779905'},{lon:'119.30417099999998',lat:'34.78371299999999'},{lon:'119.211122',lat:'34.83480599999999'},{lon:'119.20916',lat:'34.954108000000005'},{lon:'119.25048',lat:'35.053736'},{lon:'119.301779',lat:'35.076589'},{lon:'119.293231',lat:'35.111654'},{lon:'119.26201500000002',lat:'35.118066'},{lon:'119.182036',lat:'35.110883'},{lon:'119.05907700000002',lat:'35.060751'},{lon:'118.90564300000001',lat:'35.041626'},{lon:'118.772783',lat:'34.814772'},{lon:'118.768704',lat:'34.721018'},{lon:'118.673147',lat:'34.714028'},{lon:'118.673146489435',lat:'34.714028000000006'},{lon:'118.611246',lat:'34.709459'},{lon:'118.47840400000001',lat:'34.657728'},{lon:'118.40177500000001',lat:'34.47189'},{lon:'118.33101000000002',lat:'34.414732'},{lon:'118.17880799999999',lat:'34.419442'},{lon:'118.09568499999999',lat:'34.568419'},{lon:'118.09783499999999',lat:'34.655415'},{lon:'117.799982',lat:'34.65617'},{lon:'117.73400099999999',lat:'34.550149'},{lon:'117.591342',lat:'34.475707'},{lon:'117.503855',lat:'34.48514899999999'},{lon:'117.269804',lat:'34.570739'},{lon:'117.17353199999998',lat:'34.661183'},{lon:'117.007588',lat:'34.81644200000001'}];
AddRaidPolygon(raid_mapLayer, V05Jiangsu,"#4186F0","05 - Jiangsu");

var V06Hebei = [{lon:'118.43625300000001',lat:'38.881837'},{lon:'120.39917',lat:'40.153687'},{lon:'119.6145516717076',lat:'41.002699284612376'},{lon:'119.61455099999999',lat:'41.0027'},{lon:'117.77343800000001',lat:'42.892064'},{lon:'114.63747626263009',lat:'42.26969605624832'},{lon:'114.521484',lat:'42.24478500000001'},{lon:'113.225098',lat:'39.943436'},{lon:'113.269043',lat:'36.615528'},{lon:'111.75293',lat:'35.281501'},{lon:'114.43359400000001',lat:'34.777716'},{lon:'115.220352',lat:'36.22339600000001'},{lon:'115.68224200000002',lat:'36.816143000000004'},{lon:'116.013771',lat:'37.35958500000001'},{lon:'116.23786299999999',lat:'37.367661'},{lon:'116.239111',lat:'37.481403'},{lon:'116.286021',lat:'37.477221'},{lon:'116.298535',lat:'37.566563'},{lon:'116.38238800000002',lat:'37.562835'},{lon:'116.426601',lat:'37.483014'},{lon:'116.81211199999998',lat:'37.811988'},{lon:'117.441102',lat:'37.867997'},{lon:'117.566721',lat:'38.058032'},{lon:'117.762478',lat:'38.124356000000006'},{lon:'117.883959',lat:'38.265791'},{lon:'117.66004',lat:'38.631509'},{lon:'117.204702',lat:'38.606331'},{lon:'116.75445',lat:'38.784936'},{lon:'116.72973600000002',lat:'38.899583'},{lon:'116.88724500000001',lat:'39.073743'},{lon:'116.797069',lat:'39.570506'},{lon:'116.42680100000001',lat:'39.449439'},{lon:'115.837626',lat:'39.531523'},{lon:'115.51480100000002',lat:'39.622199'},{lon:'115.462144',lat:'40.01187500000001'},{lon:'115.783588',lat:'40.531637'},{lon:'116.638934',lat:'41.056906'},{lon:'117.487749',lat:'40.659646'},{lon:'117.273498',lat:'40.552523'},{lon:'117.448148',lat:'40.260654'},{lon:'117.778142',lat:'39.984108'},{lon:'118.067268',lat:'39.230776'},{lon:'118.43625300000001',lat:'38.881837'}];
AddRaidPolygon(raid_mapLayer, V06Hebei,"#0BA9CC","06 - Hebei");

var V07Hunan = [{lon:'113.61772',lat:'29.829135000000004'},{lon:'110.972636',lat:'30.940051'},{lon:'106.423284',lat:'27.811705000000003'},{lon:'112.22760800000002',lat:'25.199986'},{lon:'112.40481000000001',lat:'25.181332999999995'},{lon:'112.75902200000002',lat:'25.072112'},{lon:'112.837404',lat:'24.910083000000004'},{lon:'112.999396',lat:'24.950651'},{lon:'112.987298',lat:'25.196587999999995'},{lon:'112.805476',lat:'25.324221'},{lon:'113.297633',lat:'25.49429'},{lon:'113.672795',lat:'25.343657000000004'},{lon:'113.965091',lat:'25.413094'},{lon:'114.09835000000001',lat:'26.538516'},{lon:'113.748203',lat:'27.930903999999998'},{lon:'114.290832',lat:'28.284918'},{lon:'113.61772',lat:'29.829135000000004'}];
AddRaidPolygon(raid_mapLayer, V07Hunan,"#0BA9CC","07 - Hunan");

var V08Anhui = [{lon:'113.965024',lat:'25.402234'},{lon:'115.686035',lat:'27.205786'},{lon:'117.72949200000001',lat:'29.190533'},{lon:'118.19668400000002',lat:'29.390682'},{lon:'118.63781000000002',lat:'29.624284000000003'},{lon:'118.893716',lat:'29.939533000000004'},{lon:'118.88601000000001',lat:'30.309155000000004'},{lon:'118.949415',lat:'30.359912'},{lon:'119.230092',lat:'30.294354000000002'},{lon:'119.401055',lat:'30.368943000000005'},{lon:'119.25669',lat:'30.593488'},{lon:'119.42720400000002',lat:'30.644129000000007'},{lon:'119.57692400000002',lat:'30.838915'},{lon:'119.63742699999999',lat:'31.139739000000002'},{lon:'119.36737799999999',lat:'31.187267000000002'},{lon:'119.361341',lat:'31.290391999999997'},{lon:'119.108276',lat:'31.23511400000001'},{lon:'118.81014199999998',lat:'31.235904'},{lon:'118.723515',lat:'31.302359000000003'},{lon:'118.896471',lat:'31.486954999999995'},{lon:'118.86770200000001',lat:'31.607717999999995'},{lon:'118.67793',lat:'31.633287'},{lon:'118.67017600000001',lat:'31.738101'},{lon:'118.527071',lat:'31.733095999999996'},{lon:'118.386411',lat:'31.924009000000005'},{lon:'118.39397799999999',lat:'32.082559'},{lon:'118.50956399999998',lat:'32.112263'},{lon:'118.50740199999998',lat:'32.181271'},{lon:'118.661062',lat:'32.226575'},{lon:'118.701782',lat:'32.39967500000001'},{lon:'118.6845',lat:'32.51998999999999'},{lon:'118.627773',lat:'32.484856'},{lon:'118.57546000000002',lat:'32.569291'},{lon:'118.76726300000001',lat:'32.601811'},{lon:'118.94811000000001',lat:'32.567440000000005'},{lon:'119.071866',lat:'32.497873'},{lon:'119.183883',lat:'32.585513'},{lon:'119.205169',lat:'32.713637'},{lon:'119.13782500000002',lat:'32.841583'},{lon:'119.01091199999999',lat:'32.952075'},{lon:'118.860738',lat:'32.95175'},{lon:'118.739873',lat:'32.830966'},{lon:'118.74751900000001',lat:'32.731866'},{lon:'118.412913',lat:'32.726031'},{lon:'118.33943000000001',lat:'32.756963'},{lon:'118.23301099999999',lat:'32.897254'},{lon:'118.28033800000001',lat:'32.974608999999994'},{lon:'118.21060300000002',lat:'33.206279'},{lon:'118.064858',lat:'33.118035'},{lon:'117.917435',lat:'33.237496'},{lon:'118.16788500000001',lat:'33.705075'},{lon:'118.163845',lat:'33.769542'},{lon:'117.72413',lat:'33.723202'},{lon:'117.74984',lat:'33.880949'},{lon:'117.61059',lat:'34.01683299999999'},{lon:'117.492714',lat:'34.073131'},{lon:'117.382053',lat:'34.046675'},{lon:'117.245041',lat:'34.11232'},{lon:'117.10091199999998',lat:'34.120913'},{lon:'116.92275799999999',lat:'34.397503'},{lon:'116.372837',lat:'34.665622'},{lon:'116.16468199999998',lat:'34.411390999999995'},{lon:'116.55044500000001',lat:'34.273488'},{lon:'116.676089',lat:'33.919744'},{lon:'116.209972',lat:'33.70923100000001'},{lon:'115.64872200000002',lat:'33.60727'},{lon:'115.35462100000001',lat:'33.47608100000001'},{lon:'115.28615399999998',lat:'33.141102'},{lon:'115.214388',lat:'32.593523000000005'},{lon:'115.856358',lat:'32.498381'},{lon:'115.908483',lat:'31.80038700000001'},{lon:'115.37208000000001',lat:'31.409638999999995'},{lon:'114.98009599999999',lat:'31.476169'},{lon:'113.61772',lat:'29.819575'},{lon:'114.290772',lat:'28.275358'},{lon:'113.748192',lat:'27.921344'},{lon:'113.855176',lat:'27.361564999999995'},{lon:'114.09831100000001',lat:'26.528956'},{lon:'113.965024',lat:'25.402234'}];
AddRaidPolygon(raid_mapLayer, V08Anhui,"#DB4436","08 - Anhui");

var V09Guangxi = [{lon:'112.227717',lat:'25.190429'},{lon:'106.423284',lat:'27.811705000000003'},{lon:'101.381836',lat:'25.661334'},{lon:'106.984863',lat:'19.766704000000004'},{lon:'109.412842',lat:'21.596151'},{lon:'111.30249',lat:'22.998851999999996'},{lon:'111.269531',lat:'23.574056999999996'},{lon:'111.75293',lat:'24.056497'},{lon:'111.970198',lat:'24.723895'},{lon:'112.16531400000001',lat:'24.849098999999995'},{lon:'112.15720500000002',lat:'25.151712000000003'},{lon:'112.227717',lat:'25.190429'}];
AddRaidPolygon(raid_mapLayer, V09Guangxi,"#7C3592","09 - Guangxi");

var V10Beijing = [{lon:'118.43625300000001',lat:'38.881837'},{lon:'118.067268',lat:'39.230776'},{lon:'117.778142',lat:'39.984108'},{lon:'117.448148',lat:'40.260654'},{lon:'117.273498',lat:'40.552523'},{lon:'117.487749',lat:'40.659646'},{lon:'116.638934',lat:'41.056906'},{lon:'115.783588',lat:'40.531637'},{lon:'115.462144',lat:'40.01187500000001'},{lon:'115.51480100000002',lat:'39.622199'},{lon:'115.837626',lat:'39.531523'},{lon:'116.42680100000001',lat:'39.449439'},{lon:'116.797069',lat:'39.570506'},{lon:'116.88724500000001',lat:'39.073743'},{lon:'116.72973600000002',lat:'38.899583'},{lon:'116.75445',lat:'38.784936'},{lon:'117.204702',lat:'38.606331'},{lon:'117.66004',lat:'38.631509'},{lon:'117.883959',lat:'38.265791'},{lon:'118.43625300000001',lat:'38.881837'}];
AddRaidPolygon(raid_mapLayer, V10Beijing,"#A61B4A","10 - Beijing");

var V11Shanghai = [{lon:'122.967224',lat:'30.557531000000004'},{lon:'122.94799800000001',lat:'30.855079000000003'},{lon:'122.236633',lat:'31.502458'},{lon:'121.97026900000002',lat:'31.614954'},{lon:'121.278335',lat:'31.876148999999998'},{lon:'121.19293200000001',lat:'31.839066'},{lon:'121.134773',lat:'31.781175000000005'},{lon:'121.35981',lat:'31.542891999999995'},{lon:'121.286316',lat:'31.484892999999996'},{lon:'121.19487100000002',lat:'31.468904999999996'},{lon:'121.15213500000002',lat:'31.385643000000005'},{lon:'121.106604',lat:'31.357073'},{lon:'121.15957499999999',lat:'31.282241'},{lon:'121.048348',lat:'31.245282'},{lon:'121.06100500000001',lat:'31.159924'},{lon:'120.916901',lat:'31.081166'},{lon:'120.939515',lat:'31.010280000000005'},{lon:'121.02063399999999',lat:'30.829249999999995'},{lon:'121.27445800000001',lat:'30.678659000000003'},{lon:'121.904297',lat:'30.486551'},{lon:'122.365723',lat:'30.578815000000002'},{lon:'122.967224',lat:'30.557531000000004'}];
AddRaidPolygon(raid_mapLayer, V11Shanghai,"#D698AD","11 - Shanghai");

var V12Zhejiang = [{lon:'119.696045',lat:'24.856534'},{lon:'120.51452599999999',lat:'26.25401'},{lon:'120.805664',lat:'26.980828999999996'},{lon:'120.997925',lat:'27.235095000000005'},{lon:'121.201172',lat:'27.420538'},{lon:'121.29455600000001',lat:'27.600803'},{lon:'121.223144',lat:'27.771051'},{lon:'121.33300800000002',lat:'27.936181'},{lon:'121.563721',lat:'28.042895000000005'},{lon:'121.65710400000002',lat:'28.168875000000003'},{lon:'121.992188',lat:'28.430053000000004'},{lon:'121.89331000000001',lat:'28.892779'},{lon:'122.05810600000001',lat:'28.964895'},{lon:'122.11853',lat:'29.568679'},{lon:'122.277832',lat:'29.559123'},{lon:'122.92053200000001',lat:'30.026299999999996'},{lon:'122.82165499999999',lat:'30.529145'},{lon:'122.37659300000001',lat:'30.555881'},{lon:'121.95373500000001',lat:'30.477082999999997'},{lon:'121.701912',lat:'30.294231'},{lon:'121.56921400000002',lat:'30.192618'},{lon:'121.327515',lat:'30.344436000000005'},{lon:'121.09571099999998',lat:'30.559827999999996'},{lon:'121.27445800000001',lat:'30.678659000000003'},{lon:'121.02063399999999',lat:'30.829249999999995'},{lon:'120.939515',lat:'31.010280000000005'},{lon:'120.842584',lat:'30.980960000000007'},{lon:'120.490635',lat:'30.770570000000003'},{lon:'120.37317999999999',lat:'30.953182'},{lon:'120.19020800000001',lat:'30.933263'},{lon:'120.03165',lat:'31.025561999999994'},{lon:'119.91996400000001',lat:'31.169948999999995'},{lon:'119.63742699999999',lat:'31.139739000000002'},{lon:'119.57692400000002',lat:'30.838915'},{lon:'119.42720400000002',lat:'30.644129000000007'},{lon:'119.25669',lat:'30.593488'},{lon:'119.401055',lat:'30.368943000000005'},{lon:'119.230092',lat:'30.294354000000002'},{lon:'118.949415',lat:'30.359912'},{lon:'118.88601000000001',lat:'30.309155000000004'},{lon:'118.893716',lat:'29.939533000000004'},{lon:'118.8321',lat:'29.871630999999997'},{lon:'118.63781000000002',lat:'29.624284000000003'},{lon:'118.19668400000002',lat:'29.390682'},{lon:'117.72949200000001',lat:'29.190533'},{lon:'115.686035',lat:'27.205786'},{lon:'119.696045',lat:'24.856534'}];
AddRaidPolygon(raid_mapLayer, V12Zhejiang,"#7C3592","12 - Zhejiang");


    
	
    setTimeout(function(){CurrentRaidLocation(raid_mapLayer);},3000);
    mro_Map.events.register("moveend", Waze.map, function(){CurrentRaidLocation(raid_mapLayer);});
    mro_Map.events.register("zoomend", Waze.map, function(){CurrentRaidLocation(raid_mapLayer);});
       
}