-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Sample AnimatePointAnnotation (not done) (#15)
* - only pack the MAUI lib * - Change to IPosition instead of GeoJSON.Point for MapTappedLocation - Change MapTappedPosition to a record - Add CoordinateBounds * - Add empty example AnimatePointAnnotation * - fix issue of converting MapboxGeoJSON Point to GeoJSON.NET.Position * bumb new version
- Loading branch information
1 parent
55f833a
commit d79f6e9
Showing
40 changed files
with
331 additions
and
142 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
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
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
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,6 @@ | ||
namespace MapboxMaui; | ||
|
||
public record CoordinateBounds ( | ||
IPosition Southwest, | ||
IPosition Northeast, | ||
bool InfiniteBounds = false); |
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,5 @@ | ||
namespace MapboxMaui; | ||
|
||
public record MapTappedPosition( | ||
ScreenPosition ScreenPosition, | ||
IPosition MapPosition); |
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
31 changes: 31 additions & 0 deletions
31
src/libs/Mapbox.Maui/Platforms/Android/MapboxViewHandler.Controller.cs
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,31 @@ | ||
| ||
namespace MapboxMaui; | ||
|
||
partial class MapboxViewHandler : IMapboxController | ||
{ | ||
public CoordinateBounds GetCoordinateBoundsForCamera(CameraOptions cameraOptions) | ||
{ | ||
var mapView = mapboxFragment?.MapView; | ||
|
||
if (mapView == null) return null; | ||
|
||
var xcameraOptions = cameraOptions.ToNative(); | ||
var xbounds = mapView.MapboxMap.CoordinateBoundsForCamera(xcameraOptions); | ||
|
||
return new CoordinateBounds( | ||
xbounds.Southwest.ToMapPosition(), | ||
xbounds.Northeast.ToMapPosition(), | ||
xbounds.InfiniteBounds | ||
); | ||
} | ||
|
||
public IPosition GetMapPosition(ScreenPosition position) | ||
{ | ||
var mapView = mapboxFragment?.MapView; | ||
|
||
if (mapView == null) return null; | ||
|
||
var coords = mapView.MapboxMap.CoordinateForPixel(position.ToScreenCoordinate()); | ||
return coords.ToMapPosition(); | ||
} | ||
} |
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
34 changes: 34 additions & 0 deletions
34
src/libs/Mapbox.Maui/Platforms/iOS/MapboxViewHandler.Controller.cs
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,34 @@ | ||
using MapboxMapsObjC; | ||
|
||
namespace MapboxMaui; | ||
|
||
partial class MapboxViewHandler : IMapboxController | ||
{ | ||
public CoordinateBounds GetCoordinateBoundsForCamera(CameraOptions cameraOptions) | ||
{ | ||
var mapView = PlatformView.MapView; | ||
|
||
if (mapView == null) return null; | ||
|
||
var xcameraOptions = cameraOptions.ToNative(); | ||
var xbounds = mapView.MapboxMap().CoordinateBoundsForCameraBounds(xcameraOptions); | ||
|
||
return new CoordinateBounds( | ||
xbounds.Southeast.ToMapPosition(), | ||
xbounds.Northeast.ToMapPosition(), | ||
xbounds.InfiniteBounds | ||
); | ||
} | ||
public IPosition GetMapPosition(ScreenPosition position) | ||
{ | ||
var mapView = PlatformView.MapView; | ||
|
||
if (mapView == null) return null; | ||
|
||
var coords = mapView.MapboxMap().CoordinateFor( | ||
position.ToCGPoint() | ||
); | ||
|
||
return coords.ToMapPosition(); | ||
} | ||
} |
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
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
Oops, something went wrong.