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

PositionCircleOptions Object


Contains options for the addAccuracyCircle method of the GeoLocationProvider class.


Name Type Description



The polygon options for the geo location accuracy circle.



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.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <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)}});

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