how can use openlayers in iphone sdk - iphone

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.

Related

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)

google map link with marker (on iphone & android)

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.

How to Display offline map in iphone using Mapkit

How to Display offline map in iphone using mapkit?
if i use static image then how do i get current location and pin drop on it?
anyone has idea please suggest some solution.
Thank you.
Try this post Force MapKit use cached map tiles only/disable network programmatically
It tells about open source map OSM , helps offline map browsing.
Source from here http://developers.cloudmade.com/projects/show/iphone-sdk.
Hope this helps , or r u looking for some thing else.
Similar to What SDKs can be used for creating offline maps application for iPad/iPhone?
In iOS4+, you can use an image MKOverlay to overlay whatever you want on top of a MapKit map. You can provide a semi-transperant base map of your own providing to display when the underlying Google Map can not be loaded. But you can not control what MapKit is doing under the hood caching Google maps.

Any recommendation to customize an iPhone MapView?

I want to you iPhone LocationManager and display the position using a custom map, different from the one used by MapView. Is there any way to customize the MapView or should I rebuild my own MapView from scratch ?
Do you think MapView will be open to achieve this kind of customization in a future release of the SDK ?
Do you have any recommendation to rebuild a MapView from scratch. I will have to divided my map in level and each level in tiles. But should I associate a tile with an UIImage or should I build/manage dynamically an UIImage composed of tiles currently displayed ?
Please make sure you file a bug with Apple, asking for this feature (I already have). In the meantime, I think your best bet is to take a look at the route-me library. It emulates the built-in Google Maps application, but uses either OpenStreetMap, Microsoft VirtualEarth or CloudMade as a data source for tiles. You could add support for loading tiles from your own custom service.

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