PDA

View Full Version : Long/Lat search offline?



outbacktouring
21.04.2015, 09:40
Forgive me as I am a designer, not a coder, but I am asking if it is possible to do a longitude, latitude search offline, rather than a street address?

We have also just released our first batch of skobbler and apple powered apps for iOS.
www.appstore.com/outbacktouringptyltd (http://www.appstore.com/outbacktouringptyltd)

dandronic
21.04.2015, 10:30
You would like to know what's at a particular coordinate (lat/long)?
If yes see the offline reverse geocoding example & documentation: http://developer.skobbler.com/getting-started/ios#sec28

outbacktouring
21.04.2015, 10:38
Thanks...
User has a long, and lat and wants to enter them into the offline each and the pin to be dropped on those coordinates. So is this Reverse geocoding?
Once again, please forgive my ignorance. In the demo app reverse geocoding looks up the address, so I assume a pin could also be coded to drop and navigate to.

dandronic
21.04.2015, 10:43
No - this is "place a pin" on a coordinate and zoom the map to that area.

Adding a pin: http://developer.skobbler.com/getting-started/ios#sec13
Zooming to that particular location, do something like:


SKCoordinateRegion region;
region.center = CLLocationCoordinate2DMake(userProvidedLat, userProvidedLong);
region.zoomLevel = 17;
mapView.visibleRegion = region;

outbacktouring
21.04.2015, 10:57
Ok, user has the coordinates as -27.11111, 153.22222 and wants to navigate to that point, all offline. At present, they can not enter in a long/lat and get a pin dropped for those coordinates. That is what I was asking and I think reverse geocoding will do it if it can lookup an address, we should be able to code a pin drop.

dandronic
21.04.2015, 11:14
Would this do it?


self.annotation1 = [SKAnnotation annotation];
self.annotation1.identifier = 10;
self.annotation1.annotationType = SKAnnotationTypePurple;
self.annotation1.location = CLLocationCoordinate2DMake(-27.11111, 153.22222);
SKAnimationSettings *animationSettings = [SKAnimationSettings animationSettings];
[self.mapView addAnnotation:self.annotation1 withAnimationSettings:animationSettings];

SKCoordinateRegion region;
region.center = CLLocationCoordinate2DMake(-27.11111, 153.22222);
region.zoomLevel = 17;
mapView.visibleRegion = region;