c# - SetView in Windows Phone map with desired locations, margin and center point -


I've added a map to my Windows Phone 8 app. Now I want one with a focal point on the map. To see the point.

XAM:

  & lt; Grid X: Name = "ContentPanel" grid. Rowspan = "2" & gt; & Lt; Grid.RowDefinitions & gt; & Lt; RowDefinition Height = "68" /> & Lt; RowDefinition Height = "1" /> & Lt; Roadfinish height = "65" /> & Lt; RowDefinition Height = "1" /> & Lt; Roadfinion height = "*" /> & Lt; /Grid.RowDefinitions> & Lt; Map: map x: name = "map" grid. Line = "5" height = "800" /> & Lt; Image source = "/ property / images / pin" width = "35" height = "55" workspaceElement = "center" horizontal alignment = "center" grid. Rowspan = "5" canvas.jndex = "15" /> & Lt; Button grid Rows = "0" content = "search" /> & Lt; Button grid Rau = "4" content = "check" /> & Lt; / Grid & gt;  

View model C #

  Mapcasting zoom position = new maplayout (); Zoom location.Scentpoint = new location () {lat = center location. Statement, LNG = Center Location. Long latitude}; Zoom: Location. Location x = new location (); Zoom: Location. Place x Lightlight = First place. statement; Zoom location. place. Long = First place // Calculate the other point for the boundary zoom location. Location = GetEqivalentPoint (center location, first place); Public Location GetEqivalentPoint (System.Device.Location.GeoCoordinate Center Location, Location Location) {var dlat = CenterLocation.Latitude - location.lat; Var dlng = center Long term - Location.Lin; Location equiPoint = new location (); EquiPoint.lat = Center Location.Lyatat + DLAT; EquiPoint.lng = Center Location Quantity + dlng; Return equiPoint; }  

XAML.cs code:

  list & lt; GeoCoordinate & gt; Zoomboundary = new list & lt; GeoCoordinate & gt; (); Zoomboundary.ed (new GeoCoordinate (MapView location, location x .Let, map view location, location x.)); Zoomboundary.ed (new geographic coordinates (map view location location.lit, map view location.lng)); Map.SetView (LocationRectangle.CreateBoundingRectangle (zoomboundaries), new thickness (0, 150, 0, 300));  

The map sets the point at the desired zoom level to display that point, but the problem is that it does not hold the same focal point as before. I want to keep Centerlocation the same and want to display the first position point on the map. I am also setting the margin in Setviewview that I have placed the first position point above two buttons in the maximum XML code.

Please tell me how to improve this problem?

Try it out:

  Zero SitLock () {MyMap.Layers .clear (); Try {// ... Get coordinates "myGeoCoordinate" // Make My Current Location Map Center This.MyMap.Center = myGeoCoordinate; This.MyMap.ZoomLevel = 12; // Create a small circle to mark the existing place. Oval myCircle = new oval (); MyCircle.Fill = New SolidColorBrush (colors.Blue); MyCircle.Height = 20; MyCircle.Width = 20; MyCircle.Opacity = 50; // Create a map overlay to include circle mapoverlie myLocationOverlay = new mapoverlace (); MyLocationOverlay.Content = myCircle; MyLocationOverlay.PositionOrigin = New point (0.5, 0.5); MyLocationOverlay.GeoCoordinate = myGeoCoordinate; // Create a map-layer to include MapOverlay; MapRear myLocationLayer = new mapline (); MyLocationLayer.Add (myLocationOverlay); // Add MapLayer to Map MyMap.Layers.Add (myLocationLayer); } Hold {}}  

Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -