I am using mapbox for showing map in my app, I need to include offline map feature also. Since there is a limit in tile size download, so can anyone tell me what is the size of single tile of mapbox map? Thanks in advance!
This is equivalent to asking "what is the size of an image": tiles range from 5kb to 40kb, depending on a range of factors from the complexity of the image to the compression chosen.
Related
The problem I'm facing is similar and closely related to this issue on Github but that's for Unity SDK, my question is for iOS SDK.
I want to achieve the same thing. Let me explain, basically I have pixel grid in which each pixel'd have equal size. Pixel is set to be 10m x 10m in real world. The thing I experienced is that if pixel locates towards the northern or southern part of the world, its size is stretched like the following.
Click for larger resolution
But when such pixel locates along the equator line, or simply along the middle part of the world. It looks ok like following
Click for larger resolution
There's no problem about rendering stuff, or positioning on Mapbox. The thing is I want every pixel to be square visually.
I've read along on the issue I linked above. It relates to mercator and the world is not flat thus makes this visual happens. It looks stretched along the northern and southern part of world map. As well, I found out that there's no equal functionalities as presented in Unity SDK for this particular problem on iOS SDK, so I'm not sure which approach I should go on to solve this solution.
How can I achieve equal size of pixel on the gridline on mapbox using Mapbox iOS SDK? Is there already solutions provided in the SDK?
FYI.
My requirement also needs real distance as shown on the map. I'm not sure it'd affect the solution as presented in the link I linked above.
I use Mapbox iOS SDK 3.7.6
My initial approach is straightforward as I fix the size of pixel to be 10m x 10m, then calculate its corresponding latitude and longitude value. Use those values to position them in Mapbox treating entire world map as a tilemap. Anyway I didn't take into account mercator in calculation, so this might be the case, if so then how to do just that? Only thing from my checking as available in iOS SDK is MGLMapView's metersPerPoint(atLatitude:). No tile ID system, or Conversions.cs as seen on Unity SDK. So i'm not sure on how to go on and solve this problem.
Update
I managed to solve it and made it work!
I'll come back and post the solution.
My solution is to port sphericalmercator.js to swift, then use it in code. I use a fixed zoom level of level 22 as its visual look is closest to what I need and also before. I went with the approach to at least have it looks visually equal not necessary its physical size.
Thanks to a hint in this answer on how to use sphericalmercator.js.
Anyway from my testing with it, tile size as set when you creating an instance using SphericalMercator seems not to be in effect no matter what value I set. Only zoom level will determine number of tiles across the world map for you. Note that upper-left corner is origin which is 0,0 tile index. Lower zoom level value will generate large tile size, but higher value will generate smaller tile size.
You can take a look as SphericalMercator-swift; the code I ported from origin JS implementation as linked above along with how to use it to get tile index, or bounding box of longitude/latitude in swift code in order to do rendering stuff on top of Mapbox.
I'am trying to download offline map using Mapbox SDK and its succesfully downloaded in basic mapstyle(i.e [NSURL URLWithString:#"mapbox://styles/mapbox/basic-v9"]). but when am try to download satellite style(i.e [MGLStyle satelliteStreetsStyleURLWithVersion:9]) its not downloading as expected.
i.e if i use zoom scale as 0 - maxZoomlevel(20) of map, it throws offlinePackDidReceiveMaximumAllowedMapboxTiles exceeded error.
and if i use small zoom range its 5 - 10 its download succesfully but map shows white screen.
Does anyone tried to download offline in satellite mode ?
Is it possible to change mapbox tile limit to a greater value ?
It sounds like you are hitting the tile limit, which is 6000 tiles. The limit can be raised with an enterprise plan. The number of tiles required by a region increases with the zoom level. You've already found the workaround, which is to adjust the minimum and maximum zoom for the offline region. You can use this tile count estimator to estimate the size of your offline region.
I'm using MKMapView to display a map on my iOS app. I've simulated my location to London for the sake of example as I know it has high quality aerial imagery.
Here is a picture from Apple's own Maps app. No problems, super quality:
Here is the same place from my app at the approximately same zoom level:
It looks like it's zoomed out, cropped and zoomed into that region as satellite image is from a more "zoomed out" zoom level. At that level, all the labels disappear too (in Maps), but I've got the labels. I've got multiple instances of MKMapView and the problem is present on all of them. I don't have any special filters, scaling, or anything that would affect the rendering of the maps. In other words, the view instances themselves aren't "zoomed in" in any way. What is exactly going on and how can I make MKMapView render the map at the quality where Maps renders it?
If you are using MKMapTypeSatellite type map, consider that this type has been abandoned by Apple.
Try using MKMapTypeSatelliteFlyover or MKMapTypeHybridFlyover for a better quality.
I'm overlaying the contents of a third-party shapefile. Some of the polygons consist of 138,000 points, most of them of about 3,000-8,000. In total there are 125 polygons.
Is that normal? Can I in some way, reduce the granularity of the polygons? CPU consumption peaks at over 190% on iPhone 5, and it takes a few minutes before the first overlays pop up.
One thing you might consider is using TileMill to render the Shapefile down into raster tiles with alpha transparency. You can then use that in either MapKit or the Mapbox iOS SDK. It will be highly performant, plus you can still use interactivity going the Mapbox route. Take this map, which was made from Shapefile data in TileMill: https://a.tiles.mapbox.com/v3/newamerica.motw_poverty/page.html#6/40.086/-95.471 The same way that the mouseovers work on the web, you could use Mapbox's RMInteractiveSource API to query and show on tap or other gestures.
I have a data set with over 50,000 geocoded points (lat-long). Each point has a set of data associated with it -- things like quality, status, etc.
I'd like to make a set of density maps showing the distribution of data by those metrics. For example, one map would show the density of all items with a quality of "good".
With a smaller set of points, I'd use Google Maps and custom markers. Here, however, different segments have tens of thousands of points
Are there any APIs or libraries that could help me do this?
The solution I will be going with:
Break the area to be mapped into a
grid.
Count the number of entries
falling inside each square.
For each
square, generate a PNG with
transparency relative to the number
of entries.
Populate a Google Map with
this set of PNGs as markers.
Google Fusion Table does a nice job at it http://www.google.com/fusiontables/Home/
Good for you that your data are already geocoded, because -from my recent experience-, Google location resolver does not let you dealing with ambiguous location..
One solution could be to create bitmaps with your density maps and add them (only one at the same time) as overlay on your google map (with GGroundOverlay)
You may have a look at this post that gives an example of density map with google map. It uses the HeatMapAPI. Unfortunately, this API is not free if you use it with a large number of points...
Put build your own density bitmap may be not so complicated...
One other solution is to reduce the number of markers you can use. It could be done with the MarkerClustered library. It is not exactly a density map, but... can maybe be useful.
http://heatmap.codeplex.com/