Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Google Maps w/ Directions

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Google Maps w/ Directions

    I am making a program for a client of mine that needs to pull address records from a database and put selected addresses into Google maps. On a desktop app how can I make the Google Maps object output directions or at least show the route between two addresses. From what I can see the Google Maps object only has the ability to find a single address. Is there a way around this?

    Also, the client specifically wants this as a desktop application. I've talked to them about web apps and they said no.

    #2
    Re: Google Maps w/ Directions

    Sevin,
    It is my plan to offer this very soon. I have it working very well.
    2 addresses on google map with a marker for the route and approximate driving time. On the desktop no less. Still a couple bugs and packaging. I plan to offer it at our store. Price(if any) has not been decided, but would be real cheap. It will be all alpha product(except for the google part) tested in v8 - v12.
    Once it is done, I will post where to get it.
    Dave Mason
    [email protected]
    Skype is dave.mason46

    Comment


      #3
      Re: Google Maps w/ Directions

      Take a look and see if this will help you? Still a couple kinks in it

      googlemap.png
      Last edited by DaveM; 03-13-2015, 07:07 PM.
      Dave Mason
      [email protected]
      Skype is dave.mason46

      Comment


        #4
        Re: Google Maps w/ Directions

        It is free in the store at http://www.allstarapplications.com under free DT
        Dave Mason
        [email protected]
        Skype is dave.mason46

        Comment


          #5
          Re: Google Maps w/ Directions

          Good for Dave for making his app free.
          However, it seems to me it would be easy to roll your own if you know how to pull fields out of your table and use them to build a string for a URL. For example,

          "https://www.google.com/maps/dir/606+Clarion+Pl,+Claremont,+CA+91711/7615+Primavera+Way,+Carlsbad,+CA+92009"

          minus the quotation marks is the basic model for a point to point Google map with directions. So all you need to do is use Table.open() or Table.current() to open the table and get the needed address data and plug it in (trimmed and with the "+" signs) after the first constant part:

          URL=https://www.google.com/maps/dir/.......

          and then
          Sys_open(URL)
          will open your default browser to the map and directions.

          Raymond Lyons

          Comment


            #6
            Re: Google Maps w/ Directions

            Raymond,

            Go ahead and make it. I will happily put it up there for free download for you. and/or put it in the code archive here?
            Dave Mason
            [email protected]
            Skype is dave.mason46

            Comment


              #7
              Re: Google Maps w/ Directions

              Originally posted by DaveM View Post
              Raymond,

              Go ahead and make it. I will happily put it up there for free download for you. and/or put it in the code archive here?
              Hi Dave,

              I barely do anything anymore, so won't be making anything that could be called a full blown.

              I was just pointing out that IF one has some ability with xbasic, it would be very easy to do what Sevin was asking for inside his app, no outside app needed. And actually it is probably even easier than what I wrote, in that Google will probably automatically take care of the "+" signs in place of spaces between address words, so there is no need to deal with adding a "+" between "Clarion" and "Pl" in my example. One would just have to properly right (or all) trim the fields when putting together the needed string for the URL.

              Sevin, if you need more of an example of what I am talking about, just say so. Maybe I should have done an example already? I just assumed it wouldn't necessary. I have done similar things opening other web pages, so I know it works. Ha, maybe I should actually do a real Google Maps test before saying I know it works! Yeah, probably should! Oh well.

              Raymond Lyons

              Comment


                #8
                Re: Google Maps w/ Directions

                The real of what I gave is an aex file that you plug to any app. The udf is in it.
                The other was just for demonstration only
                Dave Mason
                [email protected]
                Skype is dave.mason46

                Comment


                  #9
                  Re: Google Maps w/ Directions

                  Sevin has not asked for an example but given I opened my mouth I decided to provide the basics of how one might roll their own Google map thing in a desktop application, either in a script or UDF. I hope this is helpful to someone. If my URL string seems too complicated for you to build for real use, or if you find a hiccup that I missed, by all means try Dave's free app. What I am showing is to just get you moving in the right (or at least one) direction if you want to do your own thing.

                  Code:
                  'This way of setting the variables is of course not the way you would do it for real.
                  'You would probably get the values from table fields in a set, maybe even from fields on an invoice form.
                  'Or whatever.
                  'The remarked out lines for the [B]address_points[/B] table (not supplied here) were simply my way 
                  'of getting some sample data from a simple one record table I created for testing only.
                  
                  'Note the extra characters (spaces) in the address and city data that get trimmed out.
                  
                  Dim From_Addrs as c ="4695 North Ave   "
                  Dim From_City as c = "Oceanside  "
                  Dim From_St as c = "CA"
                  Dim From_zip as c = "92056"
                  
                  Dim To_Addrs as c = "947 Rancheros Dr   "
                  Dim To_City as c = "San Marcos  "
                  Dim To_St as c = "CA"
                  Dim To_zip as c = "92069"
                  
                  'dim tbl as p
                  'tbl = table.open("address_points")
                  'From_Addrs = tbl.s_addrs
                  'From_City = tbl.s_city
                  'From_St = tbl.s_state
                  'From_zip = tbl.s_zip
                  
                  'To_Addrs = tbl.b_addrs
                  'To_City = tbl.b_city
                  'To_St = tbl.b_state
                  'To_zip = tbl.b_zip
                  'tbl.close()
                  
                  Dim URL as c
                  URL = "https://www.google.com/maps/dir/"+STRITRAN(alltrim(From_Addrs)," ","+")+",+"+STRITRAN(alltrim(From_City)," ","+")+"+"+From_St+"+"+From_Zip+"/"+STRITRAN(alltrim(To_Addrs)," ","+")+",+"+STRITRAN(alltrim(To_City)," ","+")+"+"+To_St+"+"+To_Zip
                  sys_open(URL)
                  
                  'The STRITRIM() function is replacing spaces with a "+" sign per what Google maps wants. Other web pages
                  'I have dealt with us a "-" sign instead, along with some other constants.

                  Comment


                    #10
                    Re: Google Maps w/ Directions

                    And in case of more ad somewhat different control:

                    Google Maps XML
                    To understand what we're going to be seeing, it's helpful to understand what's going on under the hood, so I've copied an example of the XML Google uses to geocode their maps. You can see this below.
                    <kml>
                    <Response>
                    <name>London</name>
                    <Status>
                    <code>200</code>
                    <request>geocode</request>
                    </Status>
                    <Placemark id="p1">
                    <address>London, Greater London, UK</address>
                    <AddressDetails Accuracy="4">
                    <Country>
                    <CountryNameCode>GB</CountryNameCode>
                    <AdministrativeArea>
                    <AdministrativeAreaName>England</AdministrativeAreaName>
                    <SubAdministrativeArea>
                    <SubAdministrativeAreaName>Greater London</SubAdministrativeAreaName>
                    <Locality>
                    <LocalityName>London</LocalityName>
                    </Locality>
                    </SubAdministrativeArea>
                    </AdministrativeArea>
                    </Country>
                    </AddressDetails>
                    <Point>
                    <coordinates>0.126236,51.500152,0</coordinates>
                    </Point>
                    </Placemark>
                    </Response>
                    </kml>
                    As you can see, I've done a search for London. It's presented the response code from the server (200 - found and valid), the address, how likely it is that this is the place I've queried (AddressDetails Accuracy), the country name code, and most importantly, the longitude and latitude values.
                    Just as a quick aside, if you want to view this yourself, you can do so with one of the URL strings below, but you'll need to sign up for a Google Maps API key. Now, on with the guide… http://maps.google.co.uk/maps?
                    The Google Map URL. f=q
                    This sets what kind of display the user is presented with. Can be set to q (the standard layout), d (for directions) or l (for local). Defaults to q.
                    q=location+goes+here
                    The query string. Words are separated by + signs. You can enter an address, a town, city or village, postcodes, variables of latitude and longitude (in either decimal form or as degrees, minutes and seconds) and landmarks.
                    Everything from here on in is preceded by an & sign, as it's tagged on to the end. Again (if you have no girlfriend), things get interesting...
                    near=
                    Used to specify the location instead of putting it into q. Also has the added effect of allowing you to increase the AddressDetails Accuracy value by being more precise. Mostly only useful if q is a business or suchlike.
                    z=
                    Zoom level. Can be set 19 normally, but in certain cases can go up to 23. More information on the super-high zoom level images can be found here.
                    spn=
                    Sets the span width and height that the geocoder will compute. Basically, it limits the number of degrees long/lat that will be shown.
                    sspn=
                    Sets the boundaries for the search span. Used for local searches, near as I can tell.
                    mrt=
                    Specifies the type of search (left blank by default, which searches everything). Can be set to:
                    • all – all results
                    • loc – locations based. Requires q to be filled.
                    • yp – the business search. Also requires q to be set, and works better with loc as well.
                    • kmlkmz – searches the community maps. Requires a location set either in q, loc or near.
                    • websearch – searches webpages that Google has given a geographical position.
                    • realestate – gives real estate based results. Obviously.
                    ll= Latitude and longitude of the map centre point. Must be in that order. Requires decimal format. Interestingly, you can use this without q, in which case it doesn’t show a marker.
                    sll= Similar to ll, only this sets the lat/long of the centre point for a business search. Requires the same input criteria as ll.
                    t= Sets the kind of map shown. Can be set to:
                    m – normal map
                    k – satellite
                    h – hybrid
                    p – terrain
                    Don’t ask me why those letters were used, I don’t know why either.
                    layer= Turns overlays on and off. Can be set to t for traffic or c for street view, or tc for both at the same time.
                    view= Controls the view type. Set to text for text, or map for map.
                    saddr= Sets the starting point for directions searches. You can also add text into this in brackets to bold it in the directions sidebar.
                    daddr= Sets the end point for directions searches, and again will bold any text added in brackets.You can also add "+to:" which will set via points. These can be added multiple times.
                    mrad= Allows you to add additional destination addresses. Just as a quick aside, you can use saddr=, daddr= and mrad= instead of "+to:" if you want.
                    dirflg= This controls the route that will be planned. Can be set to h for no motorways, r for public transport only or w for walking directions.
                    via= Allows you to insert via points in directions. Must be in CSV format. For example, via=1,5 addresses 1 and 5 will be via points without entries in the sidebar. The start point (which is set as 0), and 2, 3 and 4 will all show full addresses.
                    doflg= Changes the units used to measure distance (will default to the standard unit in country of origin). Change to ptk for metric or ptm for imperial.
                    cbll= The latitude and longitude values for Street View.
                    cbp= Alters the Street View window. Controls (in order) window size, bearing, tilt, zoom and pitch.
                    start= Skips the first match for search
                    num= Controls how many matches are displayed. Will accept values up to 10.
                    om= Set to 1 to open the overview map, or anything else to close it.
                    ie= Sets the input character encoding, e.g., ie=UTF8.
                    oe= Sets the output character encoding, e.g., ie=UTF8.
                    output= Sets the output format. Can be set to:
                    • html - standard
                    • js – gives you object literals and function calls
                    • kml – an XML file like the one from the start
                    • nl – XML formatted NetworkLink wrapper, which links to a URL for information to be used with Google Earth and Google Maps
                    • embed – for embedding maps into other sites (also note that this requires the s= param which is obfuscated)
                    • dragdir – outputs a JSON object containing the reverse geocode and an encoded polyline for a given route
                    f= Controls the form style. Can be set to d for the directions form, l for the local version, or q for the normal one.
                    latlng= Not sure. Inputs as 3 figures in CVS format, but only uses the last one. Seems to have something to do with business locations. Must be used with valid data for other operators. Also, must have q=. Outputs a teeny map.
                    cid= Same as latlng, but allows you to specify map size.
                    geocode= Geocoding service for embedded maps.
                    Iwloc= Does funky things with the info window. Can be set to:
                    • A-J – opens the info window over a business marker
                    • near – puts it over the green arrow (when shown)
                    • addr – places it over a set address (the default value)
                    • start, end and pausex – for use in driving directions, where x is the number of the point in question
                    iwd= Sets the info window to expanded view when set to 1.
                    iwstate1= Puts the infowindow into various edit modes. Can be set to:
                    sscorrectthiscard – standard edit mode
                    sscorrectthiscard:ssmovemarkercard – for marker position edits
                    sscorrectthiscard:ssedithistorycard – allows you to view a marker’s history
                    pw= Sets print mode.
                    msa= Does stuff with My Maps. Set to 0 show defined My Maps, b to turn the My Maps sidebar on, 1 to show the My Maps tab on its own, or 2 to go to the new My Map creator form.
                    msid= Specifies My Maps identifiers. Use it with ms and msa=0 to show particular My Maps.
                    vp= Activates Copyright Service mode. Returns information about the copyright ownership in Javascript format. Only works when the spn= and z= are set. Can also include t for map type and key for setting an API key.
                    hl= Controls the language. Can be set to:
                    Last edited by DaveM; 03-15-2015, 03:06 PM.
                    Dave Mason
                    [email protected]
                    Skype is dave.mason46

                    Comment


                      #11
                      Re: Google Maps w/ Directions

                      Dave, In your last post you (apparently) wrote:

                      The Google Map URL. If you didn't know that bit, you're shouldn�t be reading this. Moron.
                      What are we to make of this? Are many of us "morons" in your eyes or were you, perhaps, referring to yourself? Hey, I sometimes call myself a moron, but I take some offense when others do it. Or maybe a Google guy wrote the stupid words?

                      Oh well, I do so little development anymore, I think maybe I should just stop coming to this forum.

                      Raymond Lyons

                      Comment


                        #12
                        Re: Google Maps w/ Directions

                        Ray

                        Looks like a cut and paste..

                        http://www.techelp.gr/en/programs/web/google-maps.html
                        Al Buchholz
                        Bookwood Systems, LTD
                        Weekly QReportBuilder Webinars Thursday 1 pm CST

                        Occam's Razor - KISS
                        Normalize till it hurts - De-normalize till it works.
                        Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
                        When we triage a problem it is much easier to read sample systems than to read a mind.
                        "Make it as simple as possible, but not simpler."
                        Albert Einstein

                        http://www.iadn.com/images/media/iadn_member.png

                        Comment


                          #13
                          Re: Google Maps w/ Directions

                          Originally posted by Al Buchholz View Post
                          That's good to know. I left open the possibility they weren't Dave's words, and I am glad to see that they are not his.
                          The downside is that now I may not quit the forum! Shoot.

                          Raymond Lyons

                          Comment


                            #14
                            Re: Google Maps w/ Directions

                            Originally posted by Raymond Lyons View Post
                            That's good to know. I left open the possibility they weren't Dave's words, and I am glad to see that they are not his.
                            The downside is that now I may not quit the forum! Shoot.

                            Raymond Lyons
                            You can't get away that easily........
                            Al Buchholz
                            Bookwood Systems, LTD
                            Weekly QReportBuilder Webinars Thursday 1 pm CST

                            Occam's Razor - KISS
                            Normalize till it hurts - De-normalize till it works.
                            Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
                            When we triage a problem it is much easier to read sample systems than to read a mind.
                            "Make it as simple as possible, but not simpler."
                            Albert Einstein

                            http://www.iadn.com/images/media/iadn_member.png

                            Comment


                              #15
                              Re: Google Maps w/ Directions

                              I promise you. Those were not my words. I certainly don't consider anyone here a Moron. Ex-wife? Maybe, but she is not here.

                              I only left some of the verbage in due to some points made underneath.
                              Dave Mason
                              [email protected]
                              Skype is dave.mason46

                              Comment

                              Working...
                              X