-
Notifications
You must be signed in to change notification settings - Fork 80
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
problem using the served map within mapbox js api #27
Comments
It's possible that this will work (full URLs may be treated as TileJSON, which is what map = L.mapbox.map('map', 'http://localhost:8080/index.json',{ If that doesn't work, try this instead: var map = L.map('map', {
center: [51.505, -0.09],
zoom: 13
});
// add the layer to the map
L.tileLayer('http://localhost:8080/{z}/{x}/{y}.png').addTo(map); |
Ah - this does work to point it to the json file. Getting closer... However, is this actually hosting the tiles locally, or doing anything to render the map quicker / reduce external dependencies? I'm a bit confused as to how this works, as there are no locally hosted png files in this directory. This is what the json file looks like:
If I go into mapbox studio and create a blank source file, and then run
I get a tm2source folder with the data.yml and data.xml files, but then if I attempt to access my page with the map again, I get a 500 error for all the tiles, and tessera throws an error as well:
Am I missing the point in trying to serve these tiles from a local server? |
To fix If you're using
If you're using
Depends what you're trying to do. Can you elaborate? |
Well, in a perfect world, I wouldn't have to connect to mapbox for anything - everything could be run locally, so that if there were a network connection issue, the application would not stop running. A secondary goal is to make things as fast as possible - zooming in or out would load tiles as quickly as possible with minimal flicker / tiling / etc. Does tessera help with this? My understanding is that, if I run tmstyle, I should be able to view the map that is viewable from mapbox studio, however the host of the actual tiles is mapbox. If I run tmsource, I should be able to view a custom map (though I am only editing the style of a geographic map from mapbox studio, so maybe that's not of any use to me?) It seems as though tessera's purpose is to allow you to serve map files from multiple sources, but if I wanted to just serve mapbox tiles locally, I might need something like this: https://github.com/lliss/tile-converter to serve up local, raster graphics? |
Yes. However, to do that, you'd need to have a fully locally available vector data source (it looks like you're using As for speed, locally rendering won't necessarily help that. You'd be best-served by having a fully static copy of raster tiles available locally, but that's often not feasible. Rendering from vector tiles to raster tiles is the next best thing and will generally be about the same speed as what you're seeing in Mapbox studio (because it uses the same plumbing under the hood).
The host of the data tiles is Mapbox (if that's in fact the data source), the host of the raster tiles is your local machine.
There are a few different options (dynamic vs. static), but creating a local cache of raster tiles (which is what |
Thank you so much - you've cleared up a lot! I'll see what I can do On Mon, Sep 28, 2015 at 7:25 PM, Seth Fitzsimmons [email protected]
Mike Heavers |
Hi - I hope you don't mind but I've given this a month and am still stuck - I've tried three different tile serving solutions, and no matter which I use, I always end up with a map which serves the tiles properly, but all the tiles are just gray, no styling, no features. You can view what I have here I just want to be able to reproduce my mapbox map in a browser without needing to connect to the internet (using a local server only). Here are the steps I've taken with tessera:
How do I get tessera to serve up map tiles with actual features on them? If you can point me in the right direction I'd be really grateful. I'm not even that particular about the map style - it's more the marker / distance / route functionalities that mapbox provides which are needed. |
You could take a look at these posts explaining how to use https://www.azavea.com/blog/2015/05/29/converting-mapbox-studio-vector-tiles-to-rasters-2/ |
Hi - I've got tessera up and running, and can view the map by pointing my browser to:
which is really great! I'm just not sure how to use it in production code. When I attempt to replace my mapbox hosted URL in the javascript:
with the url from tessera:
I get an html error:
How do I use the tessera-served map in mapbox js?
The text was updated successfully, but these errors were encountered: