I'm trying to extract static maps using Mapbox's Static Images API. The goal is to embed these images into an HTML page/email etc. Here is a sample that I was able to generate successfully which is at zoom level 13 using custom styles I built on Mapbox Studio:
However, I need a similar static map that could be similarly extracted from Mapox's Static Image API in a clustered view when zoomed out. I've found that Mapbox doesn't support clustering via Mapbox studio (styles) so I'm running out of options on how to achieve this. I was able to come up with the below-clustered view (screenshot) using Html/javascript but then again, can't seem to figure how to retrieve a static image out of it:
Static Image API playground - https://docs.mapbox.com/playground/static/
Related
I am want to write a web app that involves navigating technical illustrations (pan, zoom) , for that i used a sample for that i used a sample
to display a non tile image using leaflet.
Now i need to input 3 or 4 image and it should stitch and diplay together and could use the technical illustrations (pan, zoom).
Could you please help me to find a solution.
Can someone help me or guide me to show clear static image of open street map.
I am using following code.
http://staticmap.openstreetmap.de/staticmap.php?center=40,-50&zoom=2&size=500x350
You have to customize the rendering of OpenStreetMap data if you don't like that rendering.
For example you could design the map as your client likes with Tilemill (https://www.mapbox.com/tilemill/) and then use MapBox APIs (https://www.mapbox.com/blog/mapbox-static-api/).
If you only need an image, Tilemill can export directly a static image.
If you want a custom font on your map you'll have to go a commercial provider Tilemill or MapCreator (2 of the most popular)
As a side note: both offer retina ready static maps (so that the fonts will look good also on retina/xxhdpi devices)
I want to create a customize map using by openlayer.But I am unable to use openlayer. I want to create map without using google map in iphone so I want to use other way in which I can fill own data in map. i think it possible by open layer , but how I dont know.So please help me.
OpenLayers is a javascript library. As a client-based map viewing utility it allows to "display map tiles, vector data and markers loaded from any source". It is similar to Leaflet.
Both of them are only helpful if you want to render on the web (in which case you would need to grab map tiles or a map image from somewhere (OpenStreetMap for instance), or set up your own map server).
If what you want is to render a map natively on iOS, then you'll probably need a toolkit to fetch and render the map tiles or image. Here're a few that could be helpful:
WhirlyGlobe-Maply;
tangram-es;
GLMap;
Mapzen iOS SDK;
Nutiteq SDK;
Mapbox iOS SDK
QuartzMaps;
you can use this by help of phonegap.
if you dont want to use phonegap then you can simply use UIWebView for that.you can load your data in it.
load HTML files in UIWebView. html file including javascript and css and image files without any problem.
NSString *fullPath = [NSBundle pathForResource:#"filename" ofType:#"html" inDirectory:path];
[yourWebView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:fullPath]]];
for more info on openLayers
It sounds like you are simply interested in providing custom maps in an iOS app. If that is so then MapBox-iOS-SDK will allow you to use many different map sources without the need for a web view. If you look at the MapBox projects on github they also have tools to help you create the maps that the SDK can use.
I've tried to open Google Map application on iphone & android. From iPhone developer reference website I am able to open the native google map from link.
http://maps.google.com/maps?ll=11.5558762589,104.921697935&z=15
However, I have trouble with adding a marker into the map. As in google static map, we can add markers into map. I wonder if we can do the same to google map link.
Hey Borey
You can add markers. But it has to be google's own preset marker.
Try this link :
http://maps.google.com/?q=5.352135,100.299683&z=17
Use q instead of ll and I think it will work.
Problems I saw:
1) Cannot choose your own marker
2) Cannot remove that 'additional marker' that tells you what's around that area.
I guess, that's the next best thing for you? For your info, I am using it too as I lack other choices.
The only way I am aware of for doing this is to use the My Maps feature of google maps. You can create a public map in My Maps. Add a marker using the toolbar in the map, then use the link button on the top right to get the URL of your public map.
Not sure how this looks on a mobile device, but I assume that it works.
Edit
Ok. So my assumption was incorrect. I tried this out on Android and iPhone and got the following results:
iPhone - Switches out to the maps application (no option to view in the browser), displays the correct region, but no markers.
Android - Gives you the option of viewing the URL in the browser or in maps. If you view in the browser, you get the correct region, but no markers.
Android - If you view on the maps application, you get the correct region and the markers.
So basically not very useful to you. When I have done this in my mobile web apps (not native), I have used static maps. You give up the dynamic functionality, but you get lots of flexibility with what gets rendered on the map.
I'm with building a map application for iPhone, and I wanted to ask what the best way is for bringing maps from a website onto the iPhone.
I want to fetch small images of size 80x80 and show them. This kind of activity might be achieved by using UIKit or OpenGL ES.
Also if you can bring to my notice some kind of achievement and guides for this thing, I would be really very thankful.
EDIT:
I need to get the custom maps for some other vendor..
Besides that i know how to get the images its the rendering part and displaying part that what my problem man.
For small static maps, you could use Google's static map API
You can construct a URL to get your image like this:
NSString* urlString = [NSString stringWithFormat:#"http://maps.google.com/staticmap?center=%f,%f&zoom=%d&size=%1.0fx%1.0f&key=%s&sensor=true",
aLocation.coordinate.latitude, aLocation.coordinate.longitude, // aLocation is set to the center of the map
kCardBackGoogleMapsZoomLevelDefault,
80, 80, // your map size
kAIGoogleMapAPIKey]; // your google maps API key
All the other maps suppliers support static tiles - Microsoft, Yahoo and CloudMade.
Take a look at this topic: http://discussions.apple.com/message.jspa?messageID=8157498. It's nearly the same as what you're asking for.
As far as displaying the scrolling map is concerned, CATiledLayer would be the way to go. It's a slightly complex class to use, but you can find some examples if you google it.
Would you be able to use iPhone SDK 3's MapKit API, or do you need to use custom maps?
If you have a set of custom tiles you want to load, you may want to look at mapping engines put together by companies like MapNinja that let you use your own tilesets.
Otherwise it's a lot of coding to do something like a tiled map engine yourself.
If you're looking to just embed a single, non scrollable map, then have a look at the Google Static Maps API, which will generate map images for you on the fly, depending on your request parameters.
If you want to implement a slippy map, then either try route-me, which works with OS 2.2.1, and supports custom tile servers. Or have a look at MapKit/Google Maps in OS 3.0.
You could also use the Route-Me project
http://code.google.com/p/route-me/
BSD Licensed - perfect if you need to render your own tiles