Skip to content
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

Merged
merged 8 commits into from
Mar 5, 2024

Conversation

bkudiess
Copy link
Contributor

@bkudiess bkudiess commented Mar 1, 2024

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

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • [ x ] New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

@karkarl
Copy link
Collaborator

karkarl commented Mar 1, 2024

/azp run

1 similar comment
@karkarl
Copy link
Collaborator

karkarl commented Mar 1, 2024

/azp run

Comment on lines 24 to 47
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);
Copy link
Collaborator

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.

Copy link
Collaborator

@niels9001 niels9001 left a 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:

  • The MapsControl listing in the menu wasn't alphabetically ordered.
  • When resizing the window the sample was cut off.
    Old:
    image

New:
image

@niels9001 niels9001 self-requested a review March 2, 2024 19:28
@karkarl
Copy link
Collaborator

karkarl commented Mar 4, 2024

/azp run

2 similar comments
@karkarl
Copy link
Collaborator

karkarl commented Mar 4, 2024

/azp run

@karkarl
Copy link
Collaborator

karkarl commented Mar 4, 2024

/azp run

@karkarl karkarl force-pushed the user/bkudiess/add-mapcontrol branch from ee0c352 to 3df79cd Compare March 4, 2024 22:44
@karkarl
Copy link
Collaborator

karkarl commented Mar 4, 2024

/azp run

@karkarl
Copy link
Collaborator

karkarl commented Mar 4, 2024

/azp run

@karkarl karkarl force-pushed the user/bkudiess/add-mapcontrol branch from 344bd5b to f65162f Compare March 5, 2024 05:22
@karkarl
Copy link
Collaborator

karkarl commented Mar 5, 2024

/azp run

@karkarl
Copy link
Collaborator

karkarl commented Mar 5, 2024

/azp run

@karkarl karkarl merged commit b9d1ad8 into main Mar 5, 2024
2 checks passed
@niels9001 niels9001 deleted the user/bkudiess/add-mapcontrol branch June 12, 2024 13:00
karkarl added a commit that referenced this pull request Jul 15, 2024
## 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants