Export (0) Print
Expand All
1 out of 2 rated this helpful - Rate this topic

PositionCircleOptions Object

Bing

Contains options for the addAccuracyCircle method of the GeoLocationProvider class.

Properties

Name Type Description

polygonOptions

PolygonOptions

The polygon options for the geo location accuracy circle.

showOnMap

boolean

A boolean indicating whether to display the geo location accuracy circle. The default value is true. If this property is set to false, a geo location accuracy circle is not drawn and any existing accuracy circles are removed.

Example

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
   <head>
      <title></title>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

      <script type="text/javascript" src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0"></script>

      <script type="text/javascript">

         var map;
         var geoLocationProvider;
         
         function GetMap()
         {
            
            // Set the map options
            var mapOptions = {credentials:"Bing Maps Key"};


            // Initialize the map
            map = new Microsoft.Maps.Map(document.getElementById("mapDiv"), mapOptions);


            // Initialize the location provider
            geoLocationProvider = new Microsoft.Maps.GeoLocationProvider(map);

            // Get the user's current location
            geoLocationProvider.getCurrentPosition({successCallback:drawCircle, showAccuracyCircle:false});
          

         }

         function drawCircle(args)
         {
            // Draw the accuracy circle using a different color
            geoLocationProvider.addAccuracyCircle(args.center, 50000, 50000, {polygonOptions:{fillColor:new Microsoft.Maps.Color(100,100,0,100), strokeColor:new Microsoft.Maps.Color(100,100,0,100)}});
         }


      </script>
   </head>
   <body onload="GetMap();">
      <div id='mapDiv' style="position:relative; width:400px; height:400px;"></div>       
   </body>
</html>
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.