在bingmaps上显示黑色背景覆盖在ploygon形状周围

时间:2017-03-27 12:01:12

标签: bing-maps

<!DOCTYPE html>
<html>
    <head>
        <script type='text/javascript' src='http://www.bing.com/api/maps/mapcontrol?branch=experimental&callback=loadMapScenario' async defer></script>
        <title>setPolygonRingsHTML</title>
        <meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
</head>
<body>

    <div id='printoutPanel'></div>

    <div id='myMap' style="position:relative; width:750px; height:450px;"></div>
    <script type='text/javascript'>

        function loadMapScenario() {
            var js_array = [[new Microsoft.Maps.Location(47.708909801732, -122.33284698829), new Microsoft.Maps.Location(47.708909801732, -122.32996277166), new Microsoft.Maps.Location(47.708909801732, -122.32707855502), new Microsoft.Maps.Location(47.706137489184, -122.32419433839), new Microsoft.Maps.Location(47.703365176637, -122.32419433839), new Microsoft.Maps.Location(47.701979020363, -122.32563644671), new Microsoft.Maps.Location(47.70059286409, -122.32419433839), new Microsoft.Maps.Location(47.70059286409, -122.32275223007), new Microsoft.Maps.Location(47.697820551542, -122.31986801343), new Microsoft.Maps.Location(47.696434395269, -122.31842590512), new Microsoft.Maps.Location(47.695048238995, -122.31842590512), new Microsoft.Maps.Location(47.695048238995, -122.3169837968), new Microsoft.Maps.Location(47.693662082721, -122.31554168848), new Microsoft.Maps.Location(47.693662082721, -122.31409958016), new Microsoft.Maps.Location(47.692275926447, -122.31265747185), new Microsoft.Maps.Location(47.692275926447, -122.31121536353), new Microsoft.Maps.Location(47.690889770174, -122.30977325521), new Microsoft.Maps.Location(47.690889770174, -122.30833114689), new Microsoft.Maps.Location(47.692275926447, -122.30688903858), new Microsoft.Maps.Location(47.690889770174, -122.30544693026), new Microsoft.Maps.Location(47.6895036139, -122.30688903858), new Microsoft.Maps.Location(47.686731301353, -122.30400482194), new Microsoft.Maps.Location(47.685345145079, -122.30400482194), new Microsoft.Maps.Location(47.683958988805, -122.30544693026), new Microsoft.Maps.Location(47.682572832531, -122.30544693026), new Microsoft.Maps.Location(47.681186676258, -122.30400482194), new Microsoft.Maps.Location(47.67841436371, -122.30400482194), new Microsoft.Maps.Location(47.675642051163, -122.30400482194), new Microsoft.Maps.Location(47.674255894889, -122.30256271362), new Microsoft.Maps.Location(47.672869738616, -122.30256271362), new Microsoft.Maps.Location(47.671483582342, -122.30112060531), new Microsoft.Maps.Location(47.670097426068, -122.30112060531), new Microsoft.Maps.Location(47.668711269794, -122.29967849699), new Microsoft.Maps.Location(47.665938957247, -122.29967849699), new Microsoft.Maps.Location(47.664552800973, -122.29823638867), new Microsoft.Maps.Location(47.6631666447, -122.29823638867), new Microsoft.Maps.Location(47.660394332152, -122.29535217203), new Microsoft.Maps.Location(47.660394332152, -122.2924679554), new Microsoft.Maps.Location(47.660394332152, -122.28958373876), new Microsoft.Maps.Location(47.660394332152, -122.28814163045), new Microsoft.Maps.Location(47.659008175879, -122.28669952213), new Microsoft.Maps.Location(47.659008175879, -122.28381530549), new Microsoft.Maps.Location(47.657622019605, -122.28237319718), new Microsoft.Maps.Location(47.657622019605, -122.28093108886), new Microsoft.Maps.Location(47.656235863331, -122.27948898054), new Microsoft.Maps.Location(47.656235863331, -122.27804687222), new Microsoft.Maps.Location(47.654849707057, -122.27660476391), new Microsoft.Maps.Location(47.654849707057, -122.27516265559), new Microsoft.Maps.Location(47.653463550784, -122.27372054727), new Microsoft.Maps.Location(47.653463550784, -122.27083633063), new Microsoft.Maps.Location(47.653463550784, -122.26939422232), new Microsoft.Maps.Location(47.65207739451, -122.267952114), new Microsoft.Maps.Location(47.65207739451, -122.26651000568), new Microsoft.Maps.Location(47.649305081963, -122.26362578905), new Microsoft.Maps.Location(47.646532769415, -122.26074157241), new Microsoft.Maps.Location(47.646532769415, -122.25785735578), new Microsoft.Maps.Location(47.646532769415, -122.25497313914), new Microsoft.Maps.Location(47.643760456868, -122.2520889225), new Microsoft.Maps.Location(47.642374300594, -122.25064681419), new Microsoft.Maps.Location(47.639601988047, -122.25064681419), new Microsoft.Maps.Location(47.638215831773, -122.25064681419), new Microsoft.Maps.Location(47.635443519226, -122.25353103082), new Microsoft.Maps.Location(47.635443519226, -122.25497313914), new Microsoft.Maps.Location(47.634057362952, -122.25641524746), new Microsoft.Maps.Location(47.634057362952, -122.25929946409), new Microsoft.Maps.Location(47.634057362952, -122.26218368073), new Microsoft.Maps.Location(47.635443519226, -122.26362578905), new Microsoft.Maps.Location(47.635443519226, -122.26506789736), new Microsoft.Maps.Location(47.634057362952, -122.26651000568), new Microsoft.Maps.Location(47.634057362952, -122.267952114), new Microsoft.Maps.Location(47.632671206678, -122.26939422232), new Microsoft.Maps.Location(47.632671206678, -122.27227843895), new Microsoft.Maps.Location(47.632671206678, -122.27516265559), new Microsoft.Maps.Location(47.632671206678, -122.27804687222), new Microsoft.Maps.Location(47.632671206678, -122.28093108886), new Microsoft.Maps.Location(47.632671206678, -122.28237319718), new Microsoft.Maps.Location(47.631285050404, -122.28381530549), new Microsoft.Maps.Location(47.629898894131, -122.28237319718), new Microsoft.Maps.Location(47.628512737857, -122.28237319718), new Microsoft.Maps.Location(47.627126581583, -122.28093108886), new Microsoft.Maps.Location(47.624354269036, -122.28093108886), new Microsoft.Maps.Location(47.622968112762, -122.27948898054), new Microsoft.Maps.Location(47.620195800215, -122.27948898054), new Microsoft.Maps.Location(47.617423487667, -122.27660476391), new Microsoft.Maps.Location(47.61465117512, -122.27660476391), new Microsoft.Maps.Location(47.613265018846, -122.27516265559), new Microsoft.Maps.Location(47.611878862573, -122.27660476391), new Microsoft.Maps.Location(47.610492706299, -122.27516265559), new Microsoft.Maps.Location(47.607720393751, -122.27516265559), new Microsoft.Maps.Location(47.604948081204, -122.27516265559), new Microsoft.Maps.Location(47.604948081204, -122.27372054727), new Microsoft.Maps.Location(47.60356192493, -122.27227843895), new Microsoft.Maps.Location(47.60356192493, -122.27083633063), new Microsoft.Maps.Location(47.602175768657, -122.26939422232), new Microsoft.Maps.Location(47.602175768657, -122.267952114), new Microsoft.Maps.Location(47.599403456109, -122.26506789736), new Microsoft.Maps.Location(47.596631143562, -122.26218368073), new Microsoft.Maps.Location(47.596631143562, -122.25929946409), new Microsoft.Maps.Location(47.598017299835, -122.25785735578), new Microsoft.Maps.Location(47.598017299835, -122.25497313914), new Microsoft.Maps.Location(47.598017299835, -122.2520889225), new Microsoft.Maps.Location(47.598017299835, -122.25064681419), new Microsoft.Maps.Location(47.596631143562, -122.24920470587), new Microsoft.Maps.Location(47.596631143562, -122.24776259755), new Microsoft.Maps.Location(47.593858831014, -122.24487838092), new Microsoft.Maps.Location(47.593858831014, -122.2434362726), new Microsoft.Maps.Location(47.595244987288, -122.24199416428), new Microsoft.Maps.Location(47.595244987288, -122.23910994765), new Microsoft.Maps.Location(47.595244987288, -122.23622573101), new Microsoft.Maps.Location(47.592472674741, -122.23334151438), new Microsoft.Maps.Location(47.591086518467, -122.23189940606), new Microsoft.Maps.Location(47.589700362193, -122.23334151438), new Microsoft.Maps.Location(47.58831420592, -122.23334151438), new Microsoft.Maps.Location(47.586928049646, -122.23478362269), new Microsoft.Maps.Location(47.586928049646, -122.23622573101), new Microsoft.Maps.Location(47.585541893372, -122.23766783933), new Microsoft.Maps.Location(47.585541893372, -122.24055205596), new Microsoft.Maps.Location(47.586928049646, -122.24199416428), new Microsoft.Maps.Location(47.586928049646, -122.2434362726), new Microsoft.Maps.Location(47.585541893372, -122.2434362726), new Microsoft.Maps.Location(47.584155737098, -122.24487838092), new Microsoft.Maps.Location(47.584155737098, -122.24632048923), new Microsoft.Maps.Location(47.581383424551, -122.24920470587), new Microsoft.Maps.Location(47.581383424551, -122.2520889225), new Microsoft.Maps.Location(47.581383424551, -122.25497313914), new Microsoft.Maps.Location(47.581383424551, -122.25785735578), new Microsoft.Maps.Location(47.581383424551, -122.25929946409), new Microsoft.Maps.Location(47.582769580825, -122.26074157241), new Microsoft.Maps.Location(47.582769580825, -122.26218368073), new Microsoft.Maps.Location(47.579997268277, -122.26506789736), new Microsoft.Maps.Location(47.579997268277, -122.26651000568), new Microsoft.Maps.Location(47.57722495573, -122.26939422232), new Microsoft.Maps.Location(47.57722495573, -122.27227843895), new Microsoft.Maps.Location(47.575838799456, -122.27372054727), new Microsoft.Maps.Location(47.575838799456, -122.27660476391), new Microsoft.Maps.Location(47.575838799456, -122.27948898054), new Microsoft.Maps.Location(47.574452643182, -122.28093108886), new Microsoft.Maps.Location(47.574452643182, -122.28381530549), new Microsoft.Maps.Location(47.575838799456, -122.28525741381), new Microsoft.Maps.Location(47.575838799456, -122.28814163045), new Microsoft.Maps.Location(47.575838799456, -122.29102584708), new Microsoft.Maps.Location(47.574452643182, -122.29102584708), new Microsoft.Maps.Location(47.573066486909, -122.28958373876), new Microsoft.Maps.Location(47.570294174361, -122.28958373876), new Microsoft.Maps.Location(47.568908018088, -122.29102584708), new Microsoft.Maps.Location(47.567521861814, -122.29102584708), new Microsoft.Maps.Location(47.564749549267, -122.29391006372), new Microsoft.Maps.Location(47.563363392993, -122.29391006372), new Microsoft.Maps.Location(47.560591080445, -122.29679428035), new Microsoft.Maps.Location(47.557818767898, -122.29679428035), new Microsoft.Maps.Location(47.556432611624, -122.29535217203), new Microsoft.Maps.Location(47.553660299077, -122.29535217203), new Microsoft.Maps.Location(47.553660299077, -122.2924679554), new Microsoft.Maps.Location(47.55088798653, -122.28958373876), new Microsoft.Maps.Location(47.548115673982, -122.28669952213), new Microsoft.Maps.Location(47.546729517708, -122.28525741381), new Microsoft.Maps.Location(47.545343361435, -122.28525741381), new Microsoft.Maps.Location(47.542571048887, -122.28237319718), new Microsoft.Maps.Location(47.53979873634, -122.28237319718), new Microsoft.Maps.Location(47.537026423792, -122.28237319718), new Microsoft.Maps.Location(47.535640267519, -122.28093108886), new Microsoft.Maps.Location(47.532867954971, -122.28093108886), new Microsoft.Maps.Location(47.531481798698, -122.28093108886), new Microsoft.Maps.Location(47.530095642424, -122.27948898054), new Microsoft.Maps.Location(47.52870948615, -122.27948898054), new Microsoft.Maps.Location(47.527323329877, -122.28093108886), new Microsoft.Maps.Location(47.525937173603, -122.28093108886), new Microsoft.Maps.Location(47.524551017329, -122.28237319718), new Microsoft.Maps.Location(47.523164861055, -122.28093108886), new Microsoft.Maps.Location(47.520392548508, -122.28093108886), new Microsoft.Maps.Location(47.519006392234, -122.28237319718), new Microsoft.Maps.Location(47.517620235961, -122.28093108886), new Microsoft.Maps.Location(47.516234079687, -122.28093108886), new Microsoft.Maps.Location(47.513461767139, -122.28381530549), new Microsoft.Maps.Location(47.512075610866, -122.28525741381), new Microsoft.Maps.Location(47.512075610866, -122.28814163045), new Microsoft.Maps.Location(47.512075610866, -122.29102584708), new Microsoft.Maps.Location(47.513461767139, -122.2924679554), new Microsoft.Maps.Location(47.513461767139, -122.29391006372), new Microsoft.Maps.Location(47.514847923413, -122.29535217203), new Microsoft.Maps.Location(47.516234079687, -122.29535217203), new Microsoft.Maps.Location(47.516234079687, -122.29679428035), new Microsoft.Maps.Location(47.519006392234, -122.29967849699), new Microsoft.Maps.Location(47.521778704782, -122.29967849699), new Microsoft.Maps.Location(47.521778704782, -122.30112060531), new Microsoft.Maps.Location(47.524551017329, -122.30400482194), new Microsoft.Maps.Location(47.527323329877, -122.30688903858), new Microsoft.Maps.Location(47.527323329877, -122.30833114689), new Microsoft.Maps.Location(47.530095642424, -122.31121536353), new Microsoft.Maps.Location(47.530095642424, -122.31409958016), new Microsoft.Maps.Location(47.531481798698, -122.31554168848), new Microsoft.Maps.Location(47.531481798698, -122.3169837968), new Microsoft.Maps.Location(47.534254111245, -122.31986801343), new Microsoft.Maps.Location(47.535640267519, -122.32131012175), new Microsoft.Maps.Location(47.537026423792, -122.32131012175), new Microsoft.Maps.Location(47.538412580066, -122.32275223007), new Microsoft.Maps.Location(47.538412580066, -122.32563644671), new Microsoft.Maps.Location(47.53979873634, -122.32707855502), new Microsoft.Maps.Location(47.53979873634, -122.32996277166), new Microsoft.Maps.Location(47.542571048887, -122.33284698829), new Microsoft.Maps.Location(47.542571048887, -122.33428909661), new Microsoft.Maps.Location(47.545343361435, -122.33717331325), new Microsoft.Maps.Location(47.546729517708, -122.33717331325), new Microsoft.Maps.Location(47.548115673982, -122.33861542156), new Microsoft.Maps.Location(47.548115673982, -122.34005752988), new Microsoft.Maps.Location(47.55088798653, -122.34294174652), new Microsoft.Maps.Location(47.55088798653, -122.34438385484), new Microsoft.Maps.Location(47.553660299077, -122.34726807147), new Microsoft.Maps.Location(47.556432611624, -122.35015228811), new Microsoft.Maps.Location(47.557818767898, -122.35159439642), new Microsoft.Maps.Location(47.559204924172, -122.35159439642), new Microsoft.Maps.Location(47.561977236719, -122.35447861306), new Microsoft.Maps.Location(47.563363392993, -122.35592072138), new Microsoft.Maps.Location(47.564749549267, -122.35592072138), new Microsoft.Maps.Location(47.56613570554, -122.35736282969), new Microsoft.Maps.Location(47.56613570554, -122.36024704633), new Microsoft.Maps.Location(47.56613570554, -122.36168915465), new Microsoft.Maps.Location(47.568908018088, -122.36457337128), new Microsoft.Maps.Location(47.570294174361, -122.3660154796), new Microsoft.Maps.Location(47.571680330635, -122.3660154796), new Microsoft.Maps.Location(47.573066486909, -122.36457337128), new Microsoft.Maps.Location(47.574452643182, -122.36457337128), new Microsoft.Maps.Location(47.575838799456, -122.36313126296), new Microsoft.Maps.Location(47.575838799456, -122.36024704633), new Microsoft.Maps.Location(47.578611112004, -122.36024704633), new Microsoft.Maps.Location(47.579997268277, -122.36168915465), new Microsoft.Maps.Location(47.582769580825, -122.36168915465), new Microsoft.Maps.Location(47.585541893372, -122.36168915465), new Microsoft.Maps.Location(47.586928049646, -122.36024704633), new Microsoft.Maps.Location(47.589700362193, -122.36024704633), new Microsoft.Maps.Location(47.591086518467, -122.36024704633), new Microsoft.Maps.Location(47.592472674741, -122.35880493801), new Microsoft.Maps.Location(47.593858831014, -122.35880493801), new Microsoft.Maps.Location(47.595244987288, -122.35736282969), new Microsoft.Maps.Location(47.598017299835, -122.35736282969), new Microsoft.Maps.Location(47.600789612383, -122.36024704633), new Microsoft.Maps.Location(47.600789612383, -122.36313126296), new Microsoft.Maps.Location(47.602175768657, -122.36457337128), new Microsoft.Maps.Location(47.602175768657, -122.3660154796), new Microsoft.Maps.Location(47.604948081204, -122.36889969624), new Microsoft.Maps.Location(47.604948081204, -122.37034180455), new Microsoft.Maps.Location(47.607720393751, -122.37322602119), new Microsoft.Maps.Location(47.609106550025, -122.37466812951), new Microsoft.Maps.Location(47.609106550025, -122.37611023782), new Microsoft.Maps.Location(47.611878862573, -122.37899445446), new Microsoft.Maps.Location(47.61465117512, -122.38187867109), new Microsoft.Maps.Location(47.616037331394, -122.38187867109), new Microsoft.Maps.Location(47.617423487667, -122.38332077941), new Microsoft.Maps.Location(47.620195800215, -122.38332077941), new Microsoft.Maps.Location(47.622968112762, -122.38332077941), new Microsoft.Maps.Location(47.624354269036, -122.38332077941), new Microsoft.Maps.Location(47.62574042531, -122.38187867109), new Microsoft.Maps.Location(47.627126581583, -122.38187867109), new Microsoft.Maps.Location(47.629898894131, -122.38476288773), new Microsoft.Maps.Location(47.632671206678, -122.38476288773), new Microsoft.Maps.Location(47.634057362952, -122.38332077941), new Microsoft.Maps.Location(47.635443519226, -122.38332077941), new Microsoft.Maps.Location(47.636829675499, -122.38187867109), new Microsoft.Maps.Location(47.636829675499, -122.38043656278), new Microsoft.Maps.Location(47.638215831773, -122.37899445446), new Microsoft.Maps.Location(47.638215831773, -122.37611023782), new Microsoft.Maps.Location(47.638215831773, -122.37322602119), new Microsoft.Maps.Location(47.638215831773, -122.37034180455), new Microsoft.Maps.Location(47.636829675499, -122.36889969624), new Microsoft.Maps.Location(47.636829675499, -122.3660154796), new Microsoft.Maps.Location(47.639601988047, -122.36313126296), new Microsoft.Maps.Location(47.639601988047, -122.36024704633), new Microsoft.Maps.Location(47.64098814432, -122.35880493801), new Microsoft.Maps.Location(47.642374300594, -122.35880493801), new Microsoft.Maps.Location(47.643760456868, -122.35736282969), new Microsoft.Maps.Location(47.645146613141, -122.35736282969), new Microsoft.Maps.Location(47.647918925689, -122.35447861306), new Microsoft.Maps.Location(47.649305081963, -122.35303650474), new Microsoft.Maps.Location(47.649305081963, -122.35159439642), new Microsoft.Maps.Location(47.650691238236, -122.35303650474), new Microsoft.Maps.Location(47.65207739451, -122.35303650474), new Microsoft.Maps.Location(47.654849707057, -122.35015228811), new Microsoft.Maps.Location(47.654849707057, -122.34871017979), new Microsoft.Maps.Location(47.656235863331, -122.34726807147), new Microsoft.Maps.Location(47.654849707057, -122.34582596315), new Microsoft.Maps.Location(47.654849707057, -122.34438385484), new Microsoft.Maps.Location(47.657622019605, -122.34726807147), new Microsoft.Maps.Location(47.659008175879, -122.34871017979), new Microsoft.Maps.Location(47.661780488426, -122.34871017979), new Microsoft.Maps.Location(47.6631666447, -122.34871017979), new Microsoft.Maps.Location(47.665938957247, -122.34582596315), new Microsoft.Maps.Location(47.668711269794, -122.34294174652), new Microsoft.Maps.Location(47.671483582342, -122.34294174652), new Microsoft.Maps.Location(47.672869738616, -122.3414996382), new Microsoft.Maps.Location(47.674255894889, -122.3414996382), new Microsoft.Maps.Location(47.675642051163, -122.34005752988), new Microsoft.Maps.Location(47.677028207437, -122.34005752988), new Microsoft.Maps.Location(47.679800519984, -122.33717331325), new Microsoft.Maps.Location(47.681186676258, -122.33861542156), new Microsoft.Maps.Location(47.683958988805, -122.33861542156), new Microsoft.Maps.Location(47.686731301353, -122.33861542156), new Microsoft.Maps.Location(47.688117457626, -122.33861542156), new Microsoft.Maps.Location(47.6895036139, -122.34005752988), new Microsoft.Maps.Location(47.690889770174, -122.34005752988), new Microsoft.Maps.Location(47.692275926447, -122.33861542156), new Microsoft.Maps.Location(47.693662082721, -122.34005752988), new Microsoft.Maps.Location(47.695048238995, -122.34005752988), new Microsoft.Maps.Location(47.696434395269, -122.33861542156), new Microsoft.Maps.Location(47.697820551542, -122.33861542156), new Microsoft.Maps.Location(47.70059286409, -122.33573120493), new Microsoft.Maps.Location(47.701979020363, -122.33428909661), new Microsoft.Maps.Location(47.701979020363, -122.33284698829), new Microsoft.Maps.Location(47.704751332911, -122.33573120493), new Microsoft.Maps.Location(47.706137489184, -122.33573120493), new Microsoft.Maps.Location(47.708909801732, -122.33284698829)], [new Microsoft.Maps.Location(47.639601988047, -122.2434362726), new Microsoft.Maps.Location(47.639601988047, -122.24199416428), new Microsoft.Maps.Location(47.638215831773, -122.24055205596), new Microsoft.Maps.Location(47.636829675499, -122.24199416428), new Microsoft.Maps.Location(47.636829675499, -122.2434362726), new Microsoft.Maps.Location(47.638215831773, -122.24487838092), new Microsoft.Maps.Location(47.639601988047, -122.2434362726)], [new Microsoft.Maps.Location(47.58831420592, -122.22613097279), new Microsoft.Maps.Location(47.58831420592, -122.22324675615), new Microsoft.Maps.Location(47.585541893372, -122.22036253952), new Microsoft.Maps.Location(47.584155737098, -122.22036253952), new Microsoft.Maps.Location(47.581383424551, -122.22324675615), new Microsoft.Maps.Location(47.581383424551, -122.22613097279), new Microsoft.Maps.Location(47.584155737098, -122.22901518942), new Microsoft.Maps.Location(47.585541893372, -122.22901518942), new Microsoft.Maps.Location(47.58831420592, -122.22613097279)], [new Microsoft.Maps.Location(47.513461767139, -122.28237319718), new Microsoft.Maps.Location(47.510689454592, -122.27948898054), new Microsoft.Maps.Location(47.509303298318, -122.27948898054), new Microsoft.Maps.Location(47.506530985771, -122.28237319718), new Microsoft.Maps.Location(47.506530985771, -122.28381530549), new Microsoft.Maps.Location(47.509303298318, -122.28669952213), new Microsoft.Maps.Location(47.510689454592, -122.28669952213), new Microsoft.Maps.Location(47.512075610866, -122.28525741381), new Microsoft.Maps.Location(47.512075610866, -122.28381530549), new Microsoft.Maps.Location(47.513461767139, -122.28237319718)], [new Microsoft.Maps.Location(47.506530985771, -122.27948898054), new Microsoft.Maps.Location(47.505144829497, -122.27804687222), new Microsoft.Maps.Location(47.503758673224, -122.27948898054), new Microsoft.Maps.Location(47.505144829497, -122.28093108886), new Microsoft.Maps.Location(47.506530985771, -122.27948898054)]];
            var map = new Microsoft.Maps.Map(document.getElementById('myMap'), {
                credentials: 'key',
                center: new Microsoft.Maps.Location(47.6062095, -122.3320708), zoom: 11});
            var polygoncolor = Microsoft.Maps.Color.fromHex('#0ca312');
            var polygon = new Microsoft.Maps.Polygon(js_array, {fillColor: 'rgba(111,111,111,0.5)', strokeColor: polygoncolor, strokeThickness: 5});
            map.entities.push(polygon);



        }
    </script>

</body>

上面的代码是我在bing地图上的多边形形状,使用这个我在形状内部得到黑色,但我希望在形状周围的黑色覆盖图像附加图像enter image description here

请帮助我实现这一目标。

1 个答案:

答案 0 :(得分:0)

您要创建的内容称为不透明蒙版。要做到这一点,你需要基本上创建一个整个世界的多边形,并在其中切出一个洞。这里有一个代码示例:http://bingmapsv8samples.azurewebsites.net/#North%20Carolina%20Map

使用V8实际上相当容易。你只需要在你的多边形中做第一个包括整个世界。以下是您的代码的更新版本:

<!DOCTYPE html>
<html>
    <head>
        <title>setPolygonRingsHTML</title>
        <meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
</head>
<body>
    <div id='myMap' style="position:relative; width:750px; height:450px;"></div>
    <script type='text/javascript'>

        function loadMapScenario() {
            var js_array = [[new Microsoft.Maps.Location(-85, -180),new Microsoft.Maps.Location(-85, 180),new Microsoft.Maps.Location(85, 180),new Microsoft.Maps.Location(85, -180)],
            [new Microsoft.Maps.Location(47.708909801732, -122.33284698829), new Microsoft.Maps.Location(47.708909801732, -122.32996277166), new Microsoft.Maps.Location(47.708909801732, -122.32707855502), new Microsoft.Maps.Location(47.706137489184, -122.32419433839), new Microsoft.Maps.Location(47.703365176637, -122.32419433839), new Microsoft.Maps.Location(47.701979020363, -122.32563644671), new Microsoft.Maps.Location(47.70059286409, -122.32419433839), new Microsoft.Maps.Location(47.70059286409, -122.32275223007), new Microsoft.Maps.Location(47.697820551542, -122.31986801343), new Microsoft.Maps.Location(47.696434395269, -122.31842590512), new Microsoft.Maps.Location(47.695048238995, -122.31842590512), new Microsoft.Maps.Location(47.695048238995, -122.3169837968), new Microsoft.Maps.Location(47.693662082721, -122.31554168848), new Microsoft.Maps.Location(47.693662082721, -122.31409958016), new Microsoft.Maps.Location(47.692275926447, -122.31265747185), new Microsoft.Maps.Location(47.692275926447, -122.31121536353), new Microsoft.Maps.Location(47.690889770174, -122.30977325521), new Microsoft.Maps.Location(47.690889770174, -122.30833114689), new Microsoft.Maps.Location(47.692275926447, -122.30688903858), new Microsoft.Maps.Location(47.690889770174, -122.30544693026), new Microsoft.Maps.Location(47.6895036139, -122.30688903858), new Microsoft.Maps.Location(47.686731301353, -122.30400482194), new Microsoft.Maps.Location(47.685345145079, -122.30400482194), new Microsoft.Maps.Location(47.683958988805, -122.30544693026), new Microsoft.Maps.Location(47.682572832531, -122.30544693026), new Microsoft.Maps.Location(47.681186676258, -122.30400482194), new Microsoft.Maps.Location(47.67841436371, -122.30400482194), new Microsoft.Maps.Location(47.675642051163, -122.30400482194), new Microsoft.Maps.Location(47.674255894889, -122.30256271362), new Microsoft.Maps.Location(47.672869738616, -122.30256271362), new Microsoft.Maps.Location(47.671483582342, -122.30112060531), new Microsoft.Maps.Location(47.670097426068, -122.30112060531), new Microsoft.Maps.Location(47.668711269794, -122.29967849699), new Microsoft.Maps.Location(47.665938957247, -122.29967849699), new Microsoft.Maps.Location(47.664552800973, -122.29823638867), new Microsoft.Maps.Location(47.6631666447, -122.29823638867), new Microsoft.Maps.Location(47.660394332152, -122.29535217203), new Microsoft.Maps.Location(47.660394332152, -122.2924679554), new Microsoft.Maps.Location(47.660394332152, -122.28958373876), new Microsoft.Maps.Location(47.660394332152, -122.28814163045), new Microsoft.Maps.Location(47.659008175879, -122.28669952213), new Microsoft.Maps.Location(47.659008175879, -122.28381530549), new Microsoft.Maps.Location(47.657622019605, -122.28237319718), new Microsoft.Maps.Location(47.657622019605, -122.28093108886), new Microsoft.Maps.Location(47.656235863331, -122.27948898054), new Microsoft.Maps.Location(47.656235863331, -122.27804687222), new Microsoft.Maps.Location(47.654849707057, -122.27660476391), new Microsoft.Maps.Location(47.654849707057, -122.27516265559), new Microsoft.Maps.Location(47.653463550784, -122.27372054727), new Microsoft.Maps.Location(47.653463550784, -122.27083633063), new Microsoft.Maps.Location(47.653463550784, -122.26939422232), new Microsoft.Maps.Location(47.65207739451, -122.267952114), new Microsoft.Maps.Location(47.65207739451, -122.26651000568), new Microsoft.Maps.Location(47.649305081963, -122.26362578905), new Microsoft.Maps.Location(47.646532769415, -122.26074157241), new Microsoft.Maps.Location(47.646532769415, -122.25785735578), new Microsoft.Maps.Location(47.646532769415, -122.25497313914), new Microsoft.Maps.Location(47.643760456868, -122.2520889225), new Microsoft.Maps.Location(47.642374300594, -122.25064681419), new Microsoft.Maps.Location(47.639601988047, -122.25064681419), new Microsoft.Maps.Location(47.638215831773, -122.25064681419), new Microsoft.Maps.Location(47.635443519226, -122.25353103082), new Microsoft.Maps.Location(47.635443519226, -122.25497313914), new Microsoft.Maps.Location(47.634057362952, -122.25641524746), new Microsoft.Maps.Location(47.634057362952, -122.25929946409), new Microsoft.Maps.Location(47.634057362952, -122.26218368073), new Microsoft.Maps.Location(47.635443519226, -122.26362578905), new Microsoft.Maps.Location(47.635443519226, -122.26506789736), new Microsoft.Maps.Location(47.634057362952, -122.26651000568), new Microsoft.Maps.Location(47.634057362952, -122.267952114), new Microsoft.Maps.Location(47.632671206678, -122.26939422232), new Microsoft.Maps.Location(47.632671206678, -122.27227843895), new Microsoft.Maps.Location(47.632671206678, -122.27516265559), new Microsoft.Maps.Location(47.632671206678, -122.27804687222), new Microsoft.Maps.Location(47.632671206678, -122.28093108886), new Microsoft.Maps.Location(47.632671206678, -122.28237319718), new Microsoft.Maps.Location(47.631285050404, -122.28381530549), new Microsoft.Maps.Location(47.629898894131, -122.28237319718), new Microsoft.Maps.Location(47.628512737857, -122.28237319718), new Microsoft.Maps.Location(47.627126581583, -122.28093108886), new Microsoft.Maps.Location(47.624354269036, -122.28093108886), new Microsoft.Maps.Location(47.622968112762, -122.27948898054), new Microsoft.Maps.Location(47.620195800215, -122.27948898054), new Microsoft.Maps.Location(47.617423487667, -122.27660476391), new Microsoft.Maps.Location(47.61465117512, -122.27660476391), new Microsoft.Maps.Location(47.613265018846, -122.27516265559), new Microsoft.Maps.Location(47.611878862573, -122.27660476391), new Microsoft.Maps.Location(47.610492706299, -122.27516265559), new Microsoft.Maps.Location(47.607720393751, -122.27516265559), new Microsoft.Maps.Location(47.604948081204, -122.27516265559), new Microsoft.Maps.Location(47.604948081204, -122.27372054727), new Microsoft.Maps.Location(47.60356192493, -122.27227843895), new Microsoft.Maps.Location(47.60356192493, -122.27083633063), new Microsoft.Maps.Location(47.602175768657, -122.26939422232), new Microsoft.Maps.Location(47.602175768657, -122.267952114), new Microsoft.Maps.Location(47.599403456109, -122.26506789736), new Microsoft.Maps.Location(47.596631143562, -122.26218368073), new Microsoft.Maps.Location(47.596631143562, -122.25929946409), new Microsoft.Maps.Location(47.598017299835, -122.25785735578), new Microsoft.Maps.Location(47.598017299835, -122.25497313914), new Microsoft.Maps.Location(47.598017299835, -122.2520889225), new Microsoft.Maps.Location(47.598017299835, -122.25064681419), new Microsoft.Maps.Location(47.596631143562, -122.24920470587), new Microsoft.Maps.Location(47.596631143562, -122.24776259755), new Microsoft.Maps.Location(47.593858831014, -122.24487838092), new Microsoft.Maps.Location(47.593858831014, -122.2434362726), new Microsoft.Maps.Location(47.595244987288, -122.24199416428), new Microsoft.Maps.Location(47.595244987288, -122.23910994765), new Microsoft.Maps.Location(47.595244987288, -122.23622573101), new Microsoft.Maps.Location(47.592472674741, -122.23334151438), new Microsoft.Maps.Location(47.591086518467, -122.23189940606), new Microsoft.Maps.Location(47.589700362193, -122.23334151438), new Microsoft.Maps.Location(47.58831420592, -122.23334151438), new Microsoft.Maps.Location(47.586928049646, -122.23478362269), new Microsoft.Maps.Location(47.586928049646, -122.23622573101), new Microsoft.Maps.Location(47.585541893372, -122.23766783933), new Microsoft.Maps.Location(47.585541893372, -122.24055205596), new Microsoft.Maps.Location(47.586928049646, -122.24199416428), new Microsoft.Maps.Location(47.586928049646, -122.2434362726), new Microsoft.Maps.Location(47.585541893372, -122.2434362726), new Microsoft.Maps.Location(47.584155737098, -122.24487838092), new Microsoft.Maps.Location(47.584155737098, -122.24632048923), new Microsoft.Maps.Location(47.581383424551, -122.24920470587), new Microsoft.Maps.Location(47.581383424551, -122.2520889225), new Microsoft.Maps.Location(47.581383424551, -122.25497313914), new Microsoft.Maps.Location(47.581383424551, -122.25785735578), new Microsoft.Maps.Location(47.581383424551, -122.25929946409), new Microsoft.Maps.Location(47.582769580825, -122.26074157241), new Microsoft.Maps.Location(47.582769580825, -122.26218368073), new Microsoft.Maps.Location(47.579997268277, -122.26506789736), new Microsoft.Maps.Location(47.579997268277, -122.26651000568), new Microsoft.Maps.Location(47.57722495573, -122.26939422232), new Microsoft.Maps.Location(47.57722495573, -122.27227843895), new Microsoft.Maps.Location(47.575838799456, -122.27372054727), new Microsoft.Maps.Location(47.575838799456, -122.27660476391), new Microsoft.Maps.Location(47.575838799456, -122.27948898054), new Microsoft.Maps.Location(47.574452643182, -122.28093108886), new Microsoft.Maps.Location(47.574452643182, -122.28381530549), new Microsoft.Maps.Location(47.575838799456, -122.28525741381), new Microsoft.Maps.Location(47.575838799456, -122.28814163045), new Microsoft.Maps.Location(47.575838799456, -122.29102584708), new Microsoft.Maps.Location(47.574452643182, -122.29102584708), new Microsoft.Maps.Location(47.573066486909, -122.28958373876), new Microsoft.Maps.Location(47.570294174361, -122.28958373876), new Microsoft.Maps.Location(47.568908018088, -122.29102584708), new Microsoft.Maps.Location(47.567521861814, -122.29102584708), new Microsoft.Maps.Location(47.564749549267, -122.29391006372), new Microsoft.Maps.Location(47.563363392993, -122.29391006372), new Microsoft.Maps.Location(47.560591080445, -122.29679428035), new Microsoft.Maps.Location(47.557818767898, -122.29679428035), new Microsoft.Maps.Location(47.556432611624, -122.29535217203), new Microsoft.Maps.Location(47.553660299077, -122.29535217203), new Microsoft.Maps.Location(47.553660299077, -122.2924679554), new Microsoft.Maps.Location(47.55088798653, -122.28958373876), new Microsoft.Maps.Location(47.548115673982, -122.28669952213), new Microsoft.Maps.Location(47.546729517708, -122.28525741381), new Microsoft.Maps.Location(47.545343361435, -122.28525741381), new Microsoft.Maps.Location(47.542571048887, -122.28237319718), new Microsoft.Maps.Location(47.53979873634, -122.28237319718), new Microsoft.Maps.Location(47.537026423792, -122.28237319718), new Microsoft.Maps.Location(47.535640267519, -122.28093108886), new Microsoft.Maps.Location(47.532867954971, -122.28093108886), new Microsoft.Maps.Location(47.531481798698, -122.28093108886), new Microsoft.Maps.Location(47.530095642424, -122.27948898054), new Microsoft.Maps.Location(47.52870948615, -122.27948898054), new Microsoft.Maps.Location(47.527323329877, -122.28093108886), new Microsoft.Maps.Location(47.525937173603, -122.28093108886), new Microsoft.Maps.Location(47.524551017329, -122.28237319718), new Microsoft.Maps.Location(47.523164861055, -122.28093108886), new Microsoft.Maps.Location(47.520392548508, -122.28093108886), new Microsoft.Maps.Location(47.519006392234, -122.28237319718), new Microsoft.Maps.Location(47.517620235961, -122.28093108886), new Microsoft.Maps.Location(47.516234079687, -122.28093108886), new Microsoft.Maps.Location(47.513461767139, -122.28381530549), new Microsoft.Maps.Location(47.512075610866, -122.28525741381), new Microsoft.Maps.Location(47.512075610866, -122.28814163045), new Microsoft.Maps.Location(47.512075610866, -122.29102584708), new Microsoft.Maps.Location(47.513461767139, -122.2924679554), new Microsoft.Maps.Location(47.513461767139, -122.29391006372), new Microsoft.Maps.Location(47.514847923413, -122.29535217203), new Microsoft.Maps.Location(47.516234079687, -122.29535217203), new Microsoft.Maps.Location(47.516234079687, -122.29679428035), new Microsoft.Maps.Location(47.519006392234, -122.29967849699), new Microsoft.Maps.Location(47.521778704782, -122.29967849699), new Microsoft.Maps.Location(47.521778704782, -122.30112060531), new Microsoft.Maps.Location(47.524551017329, -122.30400482194), new Microsoft.Maps.Location(47.527323329877, -122.30688903858), new Microsoft.Maps.Location(47.527323329877, -122.30833114689), new Microsoft.Maps.Location(47.530095642424, -122.31121536353), new Microsoft.Maps.Location(47.530095642424, -122.31409958016), new Microsoft.Maps.Location(47.531481798698, -122.31554168848), new Microsoft.Maps.Location(47.531481798698, -122.3169837968), new Microsoft.Maps.Location(47.534254111245, -122.31986801343), new Microsoft.Maps.Location(47.535640267519, -122.32131012175), new Microsoft.Maps.Location(47.537026423792, -122.32131012175), new Microsoft.Maps.Location(47.538412580066, -122.32275223007), new Microsoft.Maps.Location(47.538412580066, -122.32563644671), new Microsoft.Maps.Location(47.53979873634, -122.32707855502), new Microsoft.Maps.Location(47.53979873634, -122.32996277166), new Microsoft.Maps.Location(47.542571048887, -122.33284698829), new Microsoft.Maps.Location(47.542571048887, -122.33428909661), new Microsoft.Maps.Location(47.545343361435, -122.33717331325), new Microsoft.Maps.Location(47.546729517708, -122.33717331325), new Microsoft.Maps.Location(47.548115673982, -122.33861542156), new Microsoft.Maps.Location(47.548115673982, -122.34005752988), new Microsoft.Maps.Location(47.55088798653, -122.34294174652), new Microsoft.Maps.Location(47.55088798653, -122.34438385484), new Microsoft.Maps.Location(47.553660299077, -122.34726807147), new Microsoft.Maps.Location(47.556432611624, -122.35015228811), new Microsoft.Maps.Location(47.557818767898, -122.35159439642), new Microsoft.Maps.Location(47.559204924172, -122.35159439642), new Microsoft.Maps.Location(47.561977236719, -122.35447861306), new Microsoft.Maps.Location(47.563363392993, -122.35592072138), new Microsoft.Maps.Location(47.564749549267, -122.35592072138), new Microsoft.Maps.Location(47.56613570554, -122.35736282969), new Microsoft.Maps.Location(47.56613570554, -122.36024704633), new Microsoft.Maps.Location(47.56613570554, -122.36168915465), new Microsoft.Maps.Location(47.568908018088, -122.36457337128), new Microsoft.Maps.Location(47.570294174361, -122.3660154796), new Microsoft.Maps.Location(47.571680330635, -122.3660154796), new Microsoft.Maps.Location(47.573066486909, -122.36457337128), new Microsoft.Maps.Location(47.574452643182, -122.36457337128), new Microsoft.Maps.Location(47.575838799456, -122.36313126296), new Microsoft.Maps.Location(47.575838799456, -122.36024704633), new Microsoft.Maps.Location(47.578611112004, -122.36024704633), new Microsoft.Maps.Location(47.579997268277, -122.36168915465), new Microsoft.Maps.Location(47.582769580825, -122.36168915465), new Microsoft.Maps.Location(47.585541893372, -122.36168915465), new Microsoft.Maps.Location(47.586928049646, -122.36024704633), new Microsoft.Maps.Location(47.589700362193, -122.36024704633), new Microsoft.Maps.Location(47.591086518467, -122.36024704633), new Microsoft.Maps.Location(47.592472674741, -122.35880493801), new Microsoft.Maps.Location(47.593858831014, -122.35880493801), new Microsoft.Maps.Location(47.595244987288, -122.35736282969), new Microsoft.Maps.Location(47.598017299835, -122.35736282969), new Microsoft.Maps.Location(47.600789612383, -122.36024704633), new Microsoft.Maps.Location(47.600789612383, -122.36313126296), new Microsoft.Maps.Location(47.602175768657, -122.36457337128), new Microsoft.Maps.Location(47.602175768657, -122.3660154796), new Microsoft.Maps.Location(47.604948081204, -122.36889969624), new Microsoft.Maps.Location(47.604948081204, -122.37034180455), new Microsoft.Maps.Location(47.607720393751, -122.37322602119), new Microsoft.Maps.Location(47.609106550025, -122.37466812951), new Microsoft.Maps.Location(47.609106550025, -122.37611023782), new Microsoft.Maps.Location(47.611878862573, -122.37899445446), new Microsoft.Maps.Location(47.61465117512, -122.38187867109), new Microsoft.Maps.Location(47.616037331394, -122.38187867109), new Microsoft.Maps.Location(47.617423487667, -122.38332077941), new Microsoft.Maps.Location(47.620195800215, -122.38332077941), new Microsoft.Maps.Location(47.622968112762, -122.38332077941), new Microsoft.Maps.Location(47.624354269036, -122.38332077941), new Microsoft.Maps.Location(47.62574042531, -122.38187867109), new Microsoft.Maps.Location(47.627126581583, -122.38187867109), new Microsoft.Maps.Location(47.629898894131, -122.38476288773), new Microsoft.Maps.Location(47.632671206678, -122.38476288773), new Microsoft.Maps.Location(47.634057362952, -122.38332077941), new Microsoft.Maps.Location(47.635443519226, -122.38332077941), new Microsoft.Maps.Location(47.636829675499, -122.38187867109), new Microsoft.Maps.Location(47.636829675499, -122.38043656278), new Microsoft.Maps.Location(47.638215831773, -122.37899445446), new Microsoft.Maps.Location(47.638215831773, -122.37611023782), new Microsoft.Maps.Location(47.638215831773, -122.37322602119), new Microsoft.Maps.Location(47.638215831773, -122.37034180455), new Microsoft.Maps.Location(47.636829675499, -122.36889969624), new Microsoft.Maps.Location(47.636829675499, -122.3660154796), new Microsoft.Maps.Location(47.639601988047, -122.36313126296), new Microsoft.Maps.Location(47.639601988047, -122.36024704633), new Microsoft.Maps.Location(47.64098814432, -122.35880493801), new Microsoft.Maps.Location(47.642374300594, -122.35880493801), new Microsoft.Maps.Location(47.643760456868, -122.35736282969), new Microsoft.Maps.Location(47.645146613141, -122.35736282969), new Microsoft.Maps.Location(47.647918925689, -122.35447861306), new Microsoft.Maps.Location(47.649305081963, -122.35303650474), new Microsoft.Maps.Location(47.649305081963, -122.35159439642), new Microsoft.Maps.Location(47.650691238236, -122.35303650474), new Microsoft.Maps.Location(47.65207739451, -122.35303650474), new Microsoft.Maps.Location(47.654849707057, -122.35015228811), new Microsoft.Maps.Location(47.654849707057, -122.34871017979), new Microsoft.Maps.Location(47.656235863331, -122.34726807147), new Microsoft.Maps.Location(47.654849707057, -122.34582596315), new Microsoft.Maps.Location(47.654849707057, -122.34438385484), new Microsoft.Maps.Location(47.657622019605, -122.34726807147), new Microsoft.Maps.Location(47.659008175879, -122.34871017979), new Microsoft.Maps.Location(47.661780488426, -122.34871017979), new Microsoft.Maps.Location(47.6631666447, -122.34871017979), new Microsoft.Maps.Location(47.665938957247, -122.34582596315), new Microsoft.Maps.Location(47.668711269794, -122.34294174652), new Microsoft.Maps.Location(47.671483582342, -122.34294174652), new Microsoft.Maps.Location(47.672869738616, -122.3414996382), new Microsoft.Maps.Location(47.674255894889, -122.3414996382), new Microsoft.Maps.Location(47.675642051163, -122.34005752988), new Microsoft.Maps.Location(47.677028207437, -122.34005752988), new Microsoft.Maps.Location(47.679800519984, -122.33717331325), new Microsoft.Maps.Location(47.681186676258, -122.33861542156), new Microsoft.Maps.Location(47.683958988805, -122.33861542156), new Microsoft.Maps.Location(47.686731301353, -122.33861542156), new Microsoft.Maps.Location(47.688117457626, -122.33861542156), new Microsoft.Maps.Location(47.6895036139, -122.34005752988), new Microsoft.Maps.Location(47.690889770174, -122.34005752988), new Microsoft.Maps.Location(47.692275926447, -122.33861542156), new Microsoft.Maps.Location(47.693662082721, -122.34005752988), new Microsoft.Maps.Location(47.695048238995, -122.34005752988), new Microsoft.Maps.Location(47.696434395269, -122.33861542156), new Microsoft.Maps.Location(47.697820551542, -122.33861542156), new Microsoft.Maps.Location(47.70059286409, -122.33573120493), new Microsoft.Maps.Location(47.701979020363, -122.33428909661), new Microsoft.Maps.Location(47.701979020363, -122.33284698829), new Microsoft.Maps.Location(47.704751332911, -122.33573120493), new Microsoft.Maps.Location(47.706137489184, -122.33573120493), new Microsoft.Maps.Location(47.708909801732, -122.33284698829)], 

            [new Microsoft.Maps.Location(47.639601988047, -122.2434362726), new Microsoft.Maps.Location(47.639601988047, -122.24199416428), new Microsoft.Maps.Location(47.638215831773, -122.24055205596), new Microsoft.Maps.Location(47.636829675499, -122.24199416428), new Microsoft.Maps.Location(47.636829675499, -122.2434362726), new Microsoft.Maps.Location(47.638215831773, -122.24487838092), new Microsoft.Maps.Location(47.639601988047, -122.2434362726)], 

            [new Microsoft.Maps.Location(47.58831420592, -122.22613097279), new Microsoft.Maps.Location(47.58831420592, -122.22324675615), new Microsoft.Maps.Location(47.585541893372, -122.22036253952), new Microsoft.Maps.Location(47.584155737098, -122.22036253952), new Microsoft.Maps.Location(47.581383424551, -122.22324675615), new Microsoft.Maps.Location(47.581383424551, -122.22613097279), new Microsoft.Maps.Location(47.584155737098, -122.22901518942), new Microsoft.Maps.Location(47.585541893372, -122.22901518942), new Microsoft.Maps.Location(47.58831420592, -122.22613097279)], 

            [new Microsoft.Maps.Location(47.513461767139, -122.28237319718), new Microsoft.Maps.Location(47.510689454592, -122.27948898054), new Microsoft.Maps.Location(47.509303298318, -122.27948898054), new Microsoft.Maps.Location(47.506530985771, -122.28237319718), new Microsoft.Maps.Location(47.506530985771, -122.28381530549), new Microsoft.Maps.Location(47.509303298318, -122.28669952213), new Microsoft.Maps.Location(47.510689454592, -122.28669952213), new Microsoft.Maps.Location(47.512075610866, -122.28525741381), new Microsoft.Maps.Location(47.512075610866, -122.28381530549), new Microsoft.Maps.Location(47.513461767139, -122.28237319718)], 



    [new Microsoft.Maps.Location(47.506530985771, -122.27948898054), new Microsoft.Maps.Location(47.505144829497, -122.27804687222), new Microsoft.Maps.Location(47.503758673224, -122.27948898054), new Microsoft.Maps.Location(47.505144829497, -122.28093108886), new Microsoft.Maps.Location(47.506530985771, -122.27948898054)]];

        var map = new Microsoft.Maps.Map(document.getElementById('myMap'), {
            credentials: 'key',
            center: new Microsoft.Maps.Location(47.6062095, -122.3320708), zoom: 11});
        var polygon = new Microsoft.Maps.Polygon(js_array, {fillColor: 'rgba(111,111,111,0.5)', strokeColor: '#0ca312', strokeThickness: 5});
        map.entities.push(polygon);
    }
</script>
<script type='text/javascript' src='http://www.bing.com/api/maps/mapcontrol?branch=experimental&callback=loadMapScenario' async defer>

相关问题