Raster Map for leaflet - leaflet

i'm developping an app using leaflet. I need to have some map datas offline on my device.
To do that i have tried to download some tiles of openstreetmap.
I'm wondering if there is a simple way to create Raster images of my zones, and how i can add them on leaflet.
Thanks.

Depending on you requirements, it might be a lot of data (the whole OpenStreetmap tileset would consume 54TB disk space).
Leaflet.TileLayer.PouchDBCached/ might be a solution for you, this question has some notes on a different implementation.

You can always refer to loading and displaying a single image over specific bounds of the map, georeference specific image using example code
Example 1:
var imageUrl = 'http://www.lib.utexas.edu/maps/historical/newark_nj_1922.jpg',
imageBounds = [[40.712216, -74.22655], [40.773941, -74.12544]];
L.imageOverlay(imageUrl, imageBounds).addTo(map);
Full resource can be find here:
http://leafletjs.com/reference.html#imageoverlay
Example 2:
Or something little more robust from this great and detailed step by step tutorial:
http://build-failed.blogspot.hr/2012/11/zoomable-image-with-leaflet.html
Hope it helps

Related

Is there any option in leaflet to stitch few image together and display

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.

Static Image of Open Street map not showing clear

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)

Zoom high quality of the image to full detail without loading a large image on iPhone

I need to develop a feature into an iPhone app which will allow the user to zoom in very much on an image and display high-quality details of the image without loading the large and loading it online. I've found a example here: developer.apple.com/library/ios/#samplecode/ScrollViewSuite/ but it dont seems to zoom at full details,
And the images are store locally.
I have seem apple developer example like PhotoScroller, scrollviewsuite.
but feels they work differently just cutting the image in tiles.
Is it Possible To access asynchronously chunk of data and render it to view at same time in didReceivedData function delegate.
Please provide some tutorial or example.
Thanks
Avinash
Based on what you have said, PhotoScroller is really what you are describing. It is the only example that I know that can handle HUGE images and only display what is needed. I have used it for 100 megapixel images and it works great.

iPhone MKMapKit Image Overlay

How can an image overlay be applied to a MKMapView? Basically, when you zoom in a specific location, I want an image to appear on top of the map that gives a more detailed view of the location.
I've had a look around and found different types of methods to use. I had a working example for an older SDK using the DrawMapRect function but this no longer seems to work on 4.2.
This is a good place to start...
http://developer.apple.com/library/ios/#documentation/MapKit/Reference/MKOverlayView_class/Reference/Reference.html
I was looking for polygon sample code though.
#omniscian: If you have solved it you should post something helpful for others. This page has a high google rank.

iPhone Map Rendering

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