-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix declaration type on setCameraOptions
- Loading branch information
1 parent
5366c55
commit c54365d
Showing
4 changed files
with
34 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
samples/AzureMapsControl.Sample/Pages/WithCameraOptions.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
@page "/WithCameraOptions" | ||
|
||
@using AzureMapsControl.Components.Map | ||
<AzureMap Id="map" | ||
CameraOptions="new CameraOptions { Center= new AzureMapsControl.Components.Atlas.Position(11.581990, 48.143534), Zoom= 8.5, MinZoom = 3, MaxZoom = 12.5 }" | ||
StyleOptions="StyleOptions" | ||
EventActivationFlags="MapEventActivationFlags | ||
.None() | ||
.Enable(MapEventType.Click)" | ||
OnClick="OnMapClick" /> | ||
|
||
@code { | ||
public StyleOptions StyleOptions = new StyleOptions | ||
{ | ||
Style = MapStyle.GrayscaleDark, | ||
ShowLogo = false, | ||
ShowFeedbackLink = false | ||
}; | ||
|
||
public async Task OnMapClick(MapMouseEventArgs eventArgs) | ||
{ | ||
var options = await eventArgs.Map.GetCameraOptionsAsync(); | ||
await eventArgs.Map.SetCameraOptionsAsync(cameraOptions => { | ||
cameraOptions.Type = CameraType.Fly; | ||
cameraOptions.Duration = 1000; | ||
cameraOptions.Zoom = options.Zoom + 1; | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters