Results 1 to 4 of 4
Discuss [Maps] Sample Code for Launching it with parameters? at the Free Toolchain Software (Cydia App's) - Hackint0sh.org; Sorry in advance if I've overlooked something, but haven't been able to find anything yet... ...
  1. #1
    Newbie Array

    Join Date
    Nov 2007
    Posts
    1
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default [Maps] Sample Code for Launching it with parameters?

    Sorry in advance if I've overlooked something, but haven't been able to find anything yet...

    Working on a stupid little app locally, and have Lattitude/Longitude coordinates, and would like to pass them off to Maps.app to plot. But I can't seem to find any information about passing parameters to Maps.app...

    I know its being done somehow (used in plenty of the ever-popular fake-GPS apps - Navizon and the like), but can't find any mention of how...

    Anyone have some sample snippets, or a point in the right direction?



  2. #2
    Senior Professional Array

    Join Date
    Sep 2007
    Posts
    148
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    16

    Smile

    Quote Originally Posted by impactdni View Post
    Sorry in advance if I've overlooked something, but haven't been able to find anything yet...

    Working on a stupid little app locally, and have Lattitude/Longitude coordinates, and would like to pass them off to Maps.app to plot. But I can't seem to find any information about passing parameters to Maps.app...

    I know its being done somehow (used in plenty of the ever-popular fake-GPS apps - Navizon and the like), but can't find any mention of how...

    Anyone have some sample snippets, or a point in the right direction?
    You need to edit the com.apple.Maps.plist in the preferences folder:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    <key>Cookie</key>
    <integer>8233040045662826668</integer>
    <key>LastViewMode</key>
    <integer>1</integer>
    <key>LastViewedLatitude</key>
    <real>put your latitude here</real>
    <key>LastViewedLongitude</key>
    <real>put your longitude here</real>
    <key>LastViewedZoomScale</key>
    <real>12</real>
    <key>SearchMode</key>
    <integer>1</integer>
    <key>SearchString</key>
    <string>latitude longitude</string>
    <key>SelectedSearchResult</key>
    <integer>0</integer>
    <key>TrafficEnabled</key>
    <false/>
    </dict>
    </plist>

    Then restart the maps.app.

    Hope this help, PmgR
    =============================================
    Help stop the persecution of Falun Dafa in China!
    Stop organ harvesting from living people in China's labor camps
    http://www.faluninfo.net
    http://www.theepochtimes.com/211,111,,1.html
    =============================================
    Falun Dafa, an ancient Chinese self-cultivation practice,
    based on the principles of
    * Truthfulness * Compassion * Tolerance *
    http://www.falundafa.org
    =============================================

  3. #3
    Rookie Array

    Join Date
    Jul 2007
    Posts
    26
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    It would be cleaner to construct an NSURL that points to e.g.
    http://maps.google.com/?ie=UTF8&ll=4...71.367187&z=10
    and pass that to UIApplication's openURL method as per http://www.tuaw.com/2007/08/28/iphon...-url-launcher/

    This should be less susceptible to future changes to the Maps application.

  4. #4
    Advanced Array

    Join Date
    Sep 2007
    Location
    Gre, France
    Posts
    32
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    Hi,

    Just try openURL with the following:

    maps:q=<your query>

    it can be

    maps:q=<latitude>,<longitude>

    for instance

    maps:q=45.1939,5.71667

    drops you in the middle of the Isere river .

    EDIT: you can also directly query for directions:

    maps:saddr=<my starting address>&daddr=<my destination address>

    You separate words with "+", i.e.:

    maps:saddr=my+street+address&daddr=the+pizza+resta urant+address

    Cheers,

    Gusano.
    Last edited by gusano; 02-19-2008 at 12:26 PM.

 

 

Similar Threads

  1. MacNN: Apple posts sample Twitter code for iOS 5 developers
    By hackint0sh in forum Latest Headlines
    Replies: 0
    Last Post: 09-01-2011, 08:00 PM
  2. [Sample code/ Know-how] Summary on my recent game (first one)
    By supersuraccoon in forum iPhone Developer Exchange
    Replies: 0
    Last Post: 04-25-2011, 01:51 PM
  3. add parameters to CFBundleExecutable ?
    By Rello in forum Free Toolchain Software (Cydia App's)
    Replies: 1
    Last Post: 07-28-2008, 09:03 PM
  4. Sample Code for Beta 3?
    By lowbelly in forum iPhone Developer Exchange
    Replies: 1
    Last Post: 04-24-2008, 11:46 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Powered by vBulletin®
Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.
Search Engine Friendly URLs by vBSEO
(c) 2006-2012 Hackint0sh.org
All times are GMT +2. The time now is 01:01 PM.
twitter, follow us!