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

    #16
    Re: Google Maps w/ Directions

    Thanks Ray,

    I am doing something very similar to this right now. I have a Web Content Chrome control on my dialog with several text box controls. I have the values in the text boxes being entered into a URL string, which the web content control uses to open Google Maps with the route between the two addresses.

    The Web Content control does load extremely slow when it processes the URL. Also, it tries to load the web content over and over every time I click on the control. Is there any way to fix this?

    Comment


      #17
      Re: Google Maps w/ Directions

      Originally posted by SevinD0991 View Post
      Thanks Ray,

      I am doing something very similar to this right now. I have a Web Content Chrome control on my dialog with several text box controls. I have the values in the text boxes being entered into a URL string, which the web content control uses to open Google Maps with the route between the two addresses.

      The Web Content control does load extremely slow when it processes the URL. Also, it tries to load the web content over and over every time I click on the control. Is there any way to fix this?
      The problem with me helping is that I do not even have V12, plus I do so little with Alpha Five anymore that I am very rusty. Also, I'm guessing you are trying to do what you want in a xdialog box that brings up the map within the dialog box. My only experience with that method was with a widget the web site provided that effectively brought up just a small part of the content on the whole web page, not the entire web page. If what I think you are after is correct, what I would do is put your text box controls on a form, use them to select the addresses that get passed into the URL string and use sys_open(URL) to open your default browser in a separate window. That should fast, and won't open more than once.

      I hope someone else can provide better help.

      That said, one more thing that others may be interested in: My example used full addresses. One can also construct the string in such a way you don't need all the address detail (though that is better). For example, you should be able to put in Costco, Temecula, CA and Google maps will know and provide the address. Or without any addresses get directions from Carlsbad, CA to San Francisco, CA. I'm pretty sure you can do any of that either with my example URL string or a version of it. Interestingly, though I have not tried, I don't think you can do any of this using MapQuest instead of Google Maps.

      Raymond Lyons

      Edit: I just confirmed that my example URL string expression needs no modification to be able to deal with things such as "Jake's restaurant, Del Mar, CA" or Carlsbad to San Francisco. "Jake's restaurant" can just go in the address field--or one could add a Business Name field to the string, which would be blank if you had the actual address.
      Last edited by Raymond Lyons; 03-16-2015, 04:00 PM.

      Comment


        #18
        Re: Google Maps w/ Directions

        Ray,
        If that particular stuff works in v8, it should work in v12.
        Dave Mason
        [email protected]
        Skype is dave.mason46

        Comment


          #19
          Re: Google Maps w/ Directions

          I have tested an enhancement to my URL expression, adding the variables From_Location_Name and To_Location_Name. It works, so I thought I might as well post it here.

          Code:
          'Date Created: 17-Mar-2015 09:17:56 AM
          'Last Updated: 17-Mar-2015 09:17:56 AM
          'Created By  : Ray Lyons
          'Updated By  : Ray Lyons
          
          'This example adds variables for From_Location_Name and To_Location_Name and shows that although when available
          'it is best to have an address and zip code, Google Maps will often provide address and zip for locations
          'such as a library, a school or a business. And if you just want city/state to city/state, just leave 
          'all the other fields blank.
          
          'My example below is from a city to a named business down the road a few miles.
          'Note that if you don't put in the city and state for a location, results can be weird.
          'Interestingly, at least to me, my example will also show an option to take a commuter train
          'instead of an automobile. Way to go Google!
          
          'Obviously, how you set the values of the variables is a whole different story, specific to your application.
          
          Dim From_Location_Name as c = ""
          Dim From_Addrs as c =""
          Dim From_City as c = "Oceanside  "
          Dim From_St as c = "CA"
          Dim From_zip as c = ""
          
          Dim To_Location_Name as c = "Jake's Restaurant"
          Dim To_Addrs as c = ""
          Dim To_City as c = "Del Mar   "
          Dim To_St as c = "CA"
          Dim To_zip as c = ""
          
          Dim URL as c
          URL = "https://www.google.com/maps/dir/"+STRITRAN(alltrim(From_Location_Name)," ","+")+",+"+STRITRAN(alltrim(From_Addrs)," ","+")+",+"+STRITRAN(alltrim(From_City)," ","+")+"+"+From_St+"+"+From_Zip+"/"+STRITRAN(alltrim(To_Location_Name)," ","+")+",+"+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.
          Raymond Lyons
          Last edited by Raymond Lyons; 03-17-2015, 02:11 PM.

          Comment


            #20
            Re: Google Maps w/ Directions

            Raymond.

            I have not tested your code just yet, but remember that from one home address to another home address is much harder because of the way google handles it. ANY variation whatsoever in what they expect will cause one of the addresses to default to a business nearby to that address.

            from a business/ city to a business/city is much more forgiving.
            Dave Mason
            [email protected]
            Skype is dave.mason46

            Comment


              #21
              Re: Google Maps w/ Directions

              See if this works for everybody?? If any errors, please inform me here or anywhere you find me.

              mapgoogle.zip
              Dave Mason
              [email protected]
              Skype is dave.mason46

              Comment


                #22
                Re: Google Maps w/ Directions

                Originally posted by DaveM View Post
                See if this works for everybody?? If any errors, please inform me here or anywhere you find me.

                [ATTACH=CONFIG]39991[/ATTACH]
                Why is the function password protected? If it improves on what I have already posted, I am sure plenty of others would like to see the improvements. And yes, I know perfectly well that what I posted was bare bones that should be part of additional code that would, among other things, do some error handling, etc.. But I felt most of those interested would either be competent to add what I did not take the time to do, or they would share their additions or alternative ways of accomplishing the same thing. What I posted was at least in part done as a learning aid for some users, something I have always felt was a big part of what this forum should be about. When you hide the code it does not serve that purpose at all. Not that it has to serve that purpose, but.....

                Raymond Lyons

                Comment


                  #23
                  Re: Google Maps w/ Directions

                  Raymond,
                  1. does it work?
                  2. it has nothing to do with what you did. There may be similarities, but is drawn off what had already done.
                  3. all my udf's are auto passworded. Sorry about that.
                  4. There is a piece in there to get rid of a # sign because it gave google fits. At one point I had a 24 hour trip from china show up.
                  Last edited by DaveM; 03-20-2015, 02:32 PM.
                  Dave Mason
                  [email protected]
                  Skype is dave.mason46

                  Comment


                    #24
                    Re: Google Maps w/ Directions

                    Originally posted by DaveM View Post
                    Raymond,
                    1. does it work?
                    2. it has nothing to do with what you did. There may be similarities, but is drawn off what had already done.
                    3. password is googlemap(I think)
                    4. all my udf's are auto passworded. Sorry about that.
                    5. There is a piece in there to get rid of a # sign because it gave google fits. At one point I had a 24 hour trip from china show up.
                    Dave, yes it does work. And yes, the "#" does cause problems. However, your way of handling the # removes the entire "# 13" from the mapped address. Not a big deal in most cases, I suppose, but there is a better way.

                    In my code I handled it by putting the following 2 lines just before my URL expression:

                    From_Addrs=STRITRAN(alltrim(From_Addrs),"#","%23")
                    To_Addrs=STRITRAN(alltrim(To_Addrs),"#","%23")

                    You could do something similar in your code. Substituting "%23" for "#" leaves "# 13" in the address on Google Maps, and if there are no #'s, no harm, no foul.

                    I have not played around with it but I wonder about things such as "STE. 13" and "Suite 13", "Apt. 13" etc.. But I suspect if there are problems with those that there are ways of dealing with those too that leaves them on the map if they are part of the address. I guess the only way it would matter is if the map were printed for guidance and then when the driver got there the "# 13" or "Apt. 13" would not be printed on the map and if he/she didn't have or remember the number, it might be a problem.

                    Ray

                    Edit: I just tested a few more things. "Suite" "STE." and "Apt." do not seem to pose issues the way "#" did. They show up on the maps in my very limited testing.

                    Also, in case anyone is wondering, for HTML URL encoding a "#" = "%23" for both Windows-1252 and UTF-8. There are other codes for just about everything, e.g., "$"="%24". And, spaces can be replaced with either the "+" sign or "%20".
                    Last edited by Raymond Lyons; 03-20-2015, 12:39 AM.

                    Comment


                      #25
                      Re: Google Maps w/ Directions

                      For 1, the "apt 13" causes no problems. I don't know about the "." in there. I am sure there are a dozen things could cause it to go wrong.

                      sometimes the code gets rid of the #13 and sometimes leaves the 13. Erradic! as I tested that.

                      Isn't HTML wonderful?
                      Dave Mason
                      [email protected]
                      Skype is dave.mason46

                      Comment


                        #26
                        Re: Google Maps w/ Directions

                        Originally posted by DaveM View Post
                        For 1, the "apt 13" causes no problems. I don't know about the "." in there. I am sure there are a dozen things could cause it to go wrong.

                        sometimes the code gets rid of the #13 and sometimes leaves the 13. Erradic! as I tested that.

                        Isn't HTML wonderful?
                        Not sure what you are referring to with "sometimes the code gets rid of the #13 and sometimes leaves the 13." My guess is you are referring to your code. When I use "%23" Google Maps left "#13" all cases. I Also tested about 6 other real #xxx addresses I pulled from my Rolodex (how old school is that!). In all cases I tested, the #xxx was retained. Try "%23" in your code. It should work perfectly.

                        In any case, since this is not something I am ever going to use (I was just trying to help), I think (and hope!) I am done with this thread.

                        Raymond Lyons

                        Comment


                          #27
                          Re: Google Maps w/ Directions

                          Thanks to input by Ray, the final function is posted at Application Allstars:

                          Please enjoy it.
                          Dave Mason
                          [email protected]
                          Skype is dave.mason46

                          Comment


                            #28
                            Re: Google Maps w/ Directions

                            Dave,

                            Good, I see you used "%23" to handle the "#" sign.

                            You might also consider adding something like a Location_Name field at the beginning of the URL string. My post 19 above has an example, though at that point I was not using "%23" to handle the "#".

                            My testing showed that in most if not all cases if I did not know the address but did know the Name of the place I was looking for (e.g., a business name or things such as "City Hall", or "Dove Library") plus the city and state, that alone got me what I wanted on the map, usually including telling me the address and zip code. Leaving the Location_Name field blank when I knew the address seemed to cause no problems. On the other hand, when I did not know the address, I could also put "City Hall", "Jake's Restaurant" or etc. in the address field and that too did the job. So arguably one does not need a separate Location_Name field, as long as the user knows to put the name in the address field if they don't know the address.

                            Finally, for those interested in how I found %23 as the way to deal with the # sign, this link
                            http://www.w3schools.com/tags/ref_urlencode.asp
                            gives a complete guide to URL encoding and specifically an ASCII Encoding Reference for things such as "#" = "%23". This could be useful if one discovers other symbols being used in addition to #, though at the moment I can't think of what other symbol might pose a problem.

                            Raymond Lyons

                            Comment


                              #29
                              Re: Google Maps w/ Directions

                              has saved my butt a few times

                              I have tested almost all other symbols out there and found no problems with any of them so far. As far as the name is concerned, it was not the reason I started this exercise. In every case I will use it, there will be no need of a name. It is nice to know that a name could be added or substituted.
                              Last edited by DaveM; 03-23-2015, 06:07 PM.
                              Dave Mason
                              [email protected]
                              Skype is dave.mason46

                              Comment


                                #30
                                Re: Google Maps w/ Directions

                                Kind of hate to revive a dead horse but in perusing the Code Archive I noticed that Richard Beacham posted something Cal Locklin did for Google Maps (but not for directions):
                                http://www.alphasoftware.com/alphafo...luding-IE11%29
                                To deal with things such as "# 13" Cal effectively used urlencode(). Because this may well be a better, more comprehensive way of dealing with the encoding of any odd characters, I thought it might be good to build a script for directions based on what Cal did and see if it works. At least for the test addresses, it works. Here it is.

                                EDIT: Yikes. I just noticed that with urlencode() there really should be no need for the "%20" in the full addresses. However, I think the commas and a space between the state and zip are needed.

                                Raymond Lyons
                                Code:
                                'These addresses (Dave's) are just for testing with the problematic "# 13"
                                Dim From_Addrs as c ="12229 windriver ln # 13"
                                Dim From_City as c = "hudson"
                                Dim From_St as c = "FL"
                                Dim From_zip as c = "34667"
                                
                                Dim To_Addrs as c = "2859 TCU bv"
                                Dim To_City as c = "orlando"
                                Dim To_St as c = "Fl"
                                Dim To_zip as c = "32817"
                                
                                '--urlencode() should allow use of any default browser i.e., Chrome, IE (any ver), Firefox, Pale Moon
                                '--This is based on a script Cal Locklin did and Richard Beacham posted in the Code Archive
                                '--http://www.alphasoftware.com/alphaforum/showthread.php?113007-A5V11-Using-Google-Maps-With-Any-Browser-%28including-IE11%29
                                '--I have modifed for use with directions, and it did seem to require +"%20"+ between state and zip
                                
                                    From_addrv = urlencode(trim(From_Addrs))
                                    From_cityv = urlencode(trim(From_City))
                                    From_statev = urlencode(trim(From_St))
                                    From_zipv = urlencode(trim(From_zip))
                                
                                    From_full_addr = From_addrv + ",%20" + From_cityv + ",%20" + From_statev +"%20"+ From_zipv
                                
                                    To_addrv = urlencode(trim(To_Addrs))
                                    To_cityv = urlencode(trim(To_City))
                                    To_statev = urlencode(trim(To_St))
                                    To_zipv = urlencode(trim(To_zip))
                                
                                    To_full_addr = To_addrv + ",%20" + To_cityv + ",%20" + To_statev + "%20"+ To_zipv
                                
                                URL= "https://www.google.com/maps/dir/"+From_full_addr+"/"+To_full_addr
                                sys_open(URL)
                                Last edited by Raymond Lyons; 04-11-2015, 05:07 PM.

                                Comment

                                Working...
                                X