Discussion Forums  >  Maps, Device Location, Tracking

Replies: 7    Views: 268

PaddyO
Lost but trying
Profile
Posts: 189
Reg: Sep 11, 2013
Geelong
5,190
04/29/14 12:48 AM (9 years ago)

iOS7: Has anyone crawled inside Apple Maps' pin data?

Hi all, This might sound a bit wierd, but I'm trying to find a way into the data that's held in map pins generated by Apple Maps. Specifically, I want lats and longs of pins generated by a search. The data is in there for sure, as (a) the pins get dropped onto a location, which has been geocoded so Apple Maps knows where to drop the pin (der!) and (b) in Apple Maps if you select a pin and choose the 'share' option when its callout is tapped, you can email yourself a vcf file that includes all sorts of goodies including the lat and long of that pin. Given that the pins we drop onto our BT maps are being coded onto Apple Maps by default (for iPhone/iPad users anyway), what I want to be able to do is to get inside that data and pull out lats and longs from the results of an Apple Maps map search. This https://developer.apple.com/library/ios/documentation/userexperience/conceptual/LocationAwarenessPG/EnablingSearch/EnablingSearch.html#//apple_ref/doc/uid/TP40009497-CH10-SW1 looks promising, at least in terms of being able to send a search string to the Apple Maps geocoding fairies, but the code is then instantly putting a pin on a map for me. I don't want it shown - I just want to get the lat/long from what it's returning and use that for my own purposes. (Mwahaha!) Any ideas? Cheers Paddy
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
04/29/14 01:59 AM (9 years ago)
Hi paddy, Wouldn't it be easier to use an html post command to googles geocoding (google latitude) site to return the latitude/longitude of a street address search, then having the info either parsed into the app, or saved somewhere where it could be parsed later? Once you get the lat/long for the pins, you'll need to parse it into the app anyways, so just thinking it might be easier to use existing web tools as the source to begin with instead of reinventing the wheel. As a side note, I have a massive plugin coming out tomorrow, with just a small piece of it allowing thousands of pins automatically placed on a map based on cvs database input. I know it's the reverse of what you are looking for, but the code might help you in reversing the process? The plugin does a ton of different things, with the ability to handle thousands of map pins just being one of the many.
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
04/29/14 02:41 AM (9 years ago)
 
PaddyO
Lost but trying
Profile
Posts: 189
Reg: Sep 11, 2013
Geelong
5,190
like
04/29/14 03:17 AM (9 years ago)
Thanks Angry, I looked at the google option and from what you've suggested will probably go that way. I guess I was hoping to be able to go 'all the way' with Apple for the data, only because (for iPhone) it kind of feels like it should be more seamless... and maybe even a bit faster. I also wondered whether there might be some small differences in google's geocoding and apple's... And using google's might somehow give coordinates that are slightly 'off' on apple maps. But my fears may be unfounded. And from what I see of your new plugin - wow! I'll definitely be digging into that! Just in case your plugin does 'exactly' what I want, here's my data flow with this map/geocoding thing: 1. User enters a search term (a city name) which is set as a value and passed into the code. 2. That value is passed to a geocoding query which returns the city's lat/long to the app 3. That lat/long is passed from the app to a php query that then uses it to pull data from my remote mySQL database 4. All records from my database that match a radius search around the previously retrieved lat/long pair are then passed to the app and each is shown as a map pin, callout, etc on the BT map plugin. Like you, I have 1000+ records in my database already. I have steps 1, 3 and 4 working; my quest is for 2! I reckon your plugin will take BT by storm! Cheers Paddy.
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
04/29/14 03:40 AM (9 years ago)
Thanks Paddy, You'll be happy to know that the google maps and apple maps are pretty much identical as far as their point location. My apps in the app store (basically using the same code as my new plugin) were there since before Apple changed over their bundled maps from Google to their own, and the location pins didn't change at all. Even with my app "Ghost Hunter", where very precise locations were need (a small remote haunted cemetery in the woods for example), the pins were exactly where they were before when it used to be google maps bundled in xcode. My plugin actually just goes off of the lat/long already in your database, so it doesn't geocode an address on the fly. Not quite what you are looking to do... but would certainly come in handy for those 1000's of locations that you already have in your database. Yeah, I think it will do well for BT users... there was nothing like it, and really is a full app wrapped up into a single plugin. My other apps in the app store use the same code and they are full featured apps that have sold well for years. I basically designed it for my own personal use, but decided to release it to help out others as well. It's something that I've wanted since I started, and didn't just want to display data in a table format.
 
PaddyO
Lost but trying
Profile
Posts: 189
Reg: Sep 11, 2013
Geelong
5,190
like
04/29/14 05:24 PM (9 years ago)
Awesome, thanks Angry. Google geocoding it is! Cheers Paddy.
 
PaddyO
Lost but trying
Profile
Posts: 189
Reg: Sep 11, 2013
Geelong
5,190
like
05/01/14 07:27 PM (9 years ago)
Angry, just wanted to thank you for your suggestion. I have it working beautifully, my UITextField passes its value along to an NSURLRequest to Google maps and I get the lat/long of whatever was entered into the UITextField. Awesome stuff! Can I ask - given that you've just done this massive plugin and you're living and breathing maps - if I now want to call a (second) map screen or reload one with a new set of pins using the lat/long values I've just received (and I have them defined as variables), can I pass those into the map plugin and have it re-search my mySQL dbase for me (I assume via querying with a php file, which is what I have done for the BT_screen_map plugin already)? I'm a bit puzzled as to how I'd call a plugin again but with fresh request data, especially as the plugin is somewhat 'hard coded' in the Control panel with its external dataURL being set already. Cheers Paddy.
 
Nicks App
Code is Art
Profile
Posts: 426
Reg: May 21, 2014
Las Vegas
6,010
like
06/29/14 12:45 PM (9 years ago)
I sent Angry Ninja a PM. I'll mention it to Paddy as well. In Self Hosted BT 3.0 iOS, my current location pulsating dot is black not blue. Have you encountered this?
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.