-
-
Notifications
You must be signed in to change notification settings - Fork 335
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
Add SwiftUI & Playground for testing Metal support #65
Conversation
@@ -145,9 +140,18 @@ responder.mapView = mapView | |||
let tapGesture = UILongPressGestureRecognizer(target: mapDelegate, action: #selector(mapDelegate.handleTap)) | |||
mapView.addGestureRecognizer(tapGesture) | |||
|
|||
//: Set Style | |||
let styleJSON = "https://raw.githubusercontent.com/roblabs/openmaptiles-ios-demo/master/OSM2VectorTiles/styles/geography-class.GitHub.json" |
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.
Is it possible to move this styleJSON to this repo?
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.
We are working on MapLibre website which will host zero-configuration style and vector tiles. It should be ready in 2-4 weeks. I would suggest to use the style from there when it is ready.
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.
I'm already introducing hard coded styles, which will need to be unraveled.
In a separate branch specific to work on styles, we'll need to do some maintenance & populating of style URLs in the class MGLStyle. Then in the future we can have custom MapLibre styles usable as
let style = MGLStyle.geographyClassURL
// or
let style2 = MGLStyle.zeroConfURL
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.
Is it possible to move this styleJSON to this repo?
Good question. By chance, the style and tile data this points to are .pbf
/protobuf files, already served up by github.com. If we were to commit tile data, it may be better to go the route of having .mbtiles
from OpenMapTile.org
|
||
struct ContentView: View { | ||
var body: some View { | ||
MapView(style: "https://raw.githubusercontent.com/roblabs/openmaptiles-ios-demo/master/OSM2VectorTiles/styles/geography-class.GitHub.json") |
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.
Similar as in my other comment, can we move the file here afterwards?
|
||
func makeUIView(context: UIViewRepresentableContext<MapView>) -> MGLMapView { | ||
var frame = CGRect(x: 0, y: 0, width: 10, height: 20) | ||
// frame = .zero // TODO: investigate if this case works |
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.
Do we have the GitHub issue opened? We could reference it here.
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.
I've opened issue #67. Which will make use of this new test app.
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.
Three minor comments.
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.
Thanks @roblabs, looking good.
# Conflicts: # platform/ios/platform/ios/ios.xcodeproj/project.pbxproj
This commit has Test apps for:
The MapLibre repo now has a Swift Playground that allows you to change the style and play around with a very simple rendered map.
Editor
>Run Playground
or⇧⌘⏎
MapLibre Playground
MapLibre Swift UI