Adds Example of VectorSource with a Third Party Tileset#1449
Adds Example of VectorSource with a Third Party Tileset#1449tylergaw wants to merge 2 commits intonitaliano:masterfrom
Conversation
|
|
||
| const VECTOR_SOURCE_URL = | ||
| 'https://d25uarhxywzl1j.cloudfront.net/v0.1/{z}/{x}/{y}.mvt'; | ||
| const TILEJSON_URL = "https://s3.amazonaws.com/tgaw/tilejson.json"; |
There was a problem hiding this comment.
I'm not sure if we'll want to leave this URL in place. That's an object in an S3 bucket that I own.
There was a problem hiding this comment.
yea something we can do is just add a local tilejson file to the example app, so we can pull it off of the devices file system
There was a problem hiding this comment.
Oh sweet, didn't realize that could be a local file. I can update the example to use that instead. Also need to update my app to do the same.
|
This is a great example, we can get it worked into the v7 branch |
|
@nitaliano so v7 branch is still maintained? ;) |
|
Yes, I'm working on it again. IDK how much official support this repo will get(most likely none) but I plan to keep helping maintaining it along with others in the community. |
This PR
Adds a new example
ThirdPartyVectorTileSource.jsshowing how to useVectorSourceto consume a custom tileset. In #1448 I described an issue I ran into trying to do this. It's not an issue with the library, but I was confused by what I needed to do.The key thing that I missed from the docs was that I needed to use a TileJSON file for the
urlproperty ofVectorSource. I was incorrectly trying to use the tile url directly.How to Test
cd example && npm inpm startreact-native run-iosThe example should show a map centered on Chicago with green lines indicating...I'm not real sure what the data is, but there should be a bunch of green lines.
example screenshot
