File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -83,8 +83,8 @@ guard let style = mapView.style else {
8383 return
8484}
8585
86- if let contoursTilesURL = URL (string : " https://api.maptiler.com/tiles/contours-v2/{z}/{x}/{y}.pbf ?key=YOUR_API_KEY" ) {
87- let contoursDataSource = MTVectorTileSource (identifier : " contoursSource" , tiles : [ contoursTilesURL] )
86+ if let contoursTilesURL = URL (string : " https://api.maptiler.com/tiles/contours-v2/tiles.json ?key=YOUR_API_KEY" ) {
87+ let contoursDataSource = MTVectorTileSource (identifier : " contoursSource" , url : contoursTilesURL)
8888 style.addSource (contoursDataSource)
8989
9090 let contoursLayer = MTLineLayer (identifier : " contoursLayer" , sourceIdentifier : contoursDataSource.identifier , sourceLayer : " contour_ft" )
@@ -102,7 +102,7 @@ if let contoursTilesURL = URL(string: "https://api.maptiler.com/tiles/contours-v
102102
103103var body: some View {
104104 MTMapViewContainer (map : mapView) {
105- MTVectorTileSource (identifier : " countoursSource" , tiles : [ URL (string : " https://api.maptiler.com/tiles/contours-v2/{z}/{x}/{y}.pbf ?key=YOUR_API_KEY" )] )
105+ MTVectorTileSource (identifier : " countoursSource" , url : URL (string : " https://api.maptiler.com/tiles/contours-v2/tiles.json ?key=YOUR_API_KEY" ))
106106
107107 MTLineLayer (identifier : " contoursLayer" , sourceIdentifier : " countoursSource" , sourceLayer : " contour_ft" )
108108 .color (.brown )
You can’t perform that action at this time.
0 commit comments