-
Notifications
You must be signed in to change notification settings - Fork 652
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding a MapControl page in the Media section #1466
Conversation
/azp run |
1 similar comment
/azp run |
var myLandmarks = new List<MapElement>(); | ||
|
||
BasicGeoposition centerPosition = new BasicGeoposition { Latitude = 0, Longitude = 0 }; | ||
Geopoint centerPoint = new Geopoint(centerPosition); | ||
|
||
map1.Center = centerPoint; | ||
map1.ZoomLevel = 1; | ||
|
||
BasicGeoposition position = new BasicGeoposition { Latitude = -30.034647, Longitude = -51.217659 }; | ||
Geopoint point = new Geopoint(position); | ||
|
||
var icon = new MapIcon | ||
{ | ||
Location = point, | ||
}; | ||
|
||
myLandmarks.Add(icon); | ||
|
||
var LandmarksLayer = new MapElementsLayer | ||
{ | ||
MapElements = myLandmarks | ||
}; | ||
|
||
map1.Layers.Add(LandmarksLayer); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Depending on how expensive this, we might want to do this in the OnLoaded event. Otherwise, navigation might "lag" as it waits for the page constructor before navigating to the page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bkudiess I pushed two commits:
/azp run |
2 similar comments
/azp run |
/azp run |
ee0c352
to
3df79cd
Compare
/azp run |
/azp run |
344bd5b
to
f65162f
Compare
/azp run |
/azp run |
## Description Adds a MapControl page to the app ## Motivation and Context MapControl was in introduced in WinAppSDK 1.5 and this page demonstrates how to use the control. ## How Has This Been Tested? Ad-hoc testing running app locally. ## Screenshots (if appropriate): ![image](https://github.com/microsoft/WinUI-Gallery/assets/7658216/6595954f-7639-4546-bcc8-24f31b0cfb47) Co-authored-by: bkudiess <barbara.kudiess@microsoft.com> Co-authored-by: Niels Laute <niels.laute@live.nl> Co-authored-by: Karen Lai <biilai@microsoft.com>
Description
Adds a MapControl page to the app
Motivation and Context
MapControl was in introduced in WinAppSDK 1.5 and this page demonstrates how to use the control.
How Has This Been Tested?
Ad-hoc testing running app locally.
Screenshots (if appropriate):
Types of changes