public void GetMapViewRadius_Test()
        {
            double MapZoomLevel = 10;
            double MaxMapViewRadius = 400;
            double expected = 30574.609375;

            MapViewRadius mvr = new MapViewRadius();
            double actual = mvr.GetMapViewRadius(MapZoomLevel, MaxMapViewRadius);

            Assert.AreEqual(expected, actual);
        }
        private void map_ZoomLevelChanged(MapControl sender, object args)
        {
            //Get Map View Radius
            MapViewRadius mvr = new MapViewRadius();
            radius = Convert.ToInt32(mvr.GetMapViewRadius(map.ZoomLevel, map.ActualHeight));

            //Depenting on map view radius set the search radius
            //limit of Foursquare API: 100km search radius
            if (radius > 100000) 
            {
                if (searchIsAvailable) errorMsgShow.Begin();
                searchIsAvailable = false;
            }
            else
            {
                if (!searchIsAvailable) errorMsgHide.Begin();
                searchIsAvailable = true;
            }
        }