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 map Api and V9 Web Content Super Control

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

    Google map Api and V9 Web Content Super Control

    This week see thread from Keith I promised to "whip up"an example of a map layout as required in the thread. After playing around with the code made available by Google labs. I came up with this example, as can be seen in attached database. This is based upon the V9 Web Content form from within the AlphaSports Example and contains only the customer database with a dummy Menu Form and a revised V9 Web Content form based upon the tweaking of the Map API available. There is also a A5 page which when opened in the HTML Editor in Source mode contains all the neccessary code to implement such a page on any web server.
    The only requirement is to supply the "Key=" value which can be obtained from this link Google API

    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
     
     
    AV9 Layouts as seen in this screen shot the ActiveX Browse configuration genie can be adapted to use your web page along the same query expression format as the google template supplied in A5V9:
     
    [IMG]http://bellsinisrael.com/template.jpg[/IMG]
    <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
        <title>Google Maps JavaScript API Example</title>
    <script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAA5zimVReFlYXk2cEGwIMLWBRpn_6bnnYaPzolxsoN1kXNJgZiLBTvzzqzgTOydXsPW4VsB4k7kLeozg" type="text/javascript"></script>
    <script type="text/javascript">
     
      function gup( name )
     {
      name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); 
     var regexS = "[\\?&]"+name+"=([^&#]*)"; 
     var regex = new RegExp( regexS ); 
     var results = regex.exec( window.location.href );
      if( results == null )    return "";  else    return results[1];
     }
     
      function load() {
        if (GBrowserIsCompatible()) {
          var map = new GMap2(document.getElementById("map"));
          var geocoder = new GClientGeocoder();
          var q_param =  gup('q');
          geocoder.getLatLng(
            q_param,
            function(point) {
              if(!point) {
                alert(q_param + "not found");
              } else {
                map.setCenter(point, 13);
                var marker = new GMarker(point);
                map.addOverlay(marker);
                //marker.openInfoWindowHtml(address); // Opens info window
                map.addControl(new GSmallMapControl()); 
                map.addControl(new GMapTypeControl()); 
              }
            }
          );
        }
      }
     
    </script>
      </head>
      <body onload="load()" onunload="GUnload()">
        <div id="map" style="width: 800px; height: 600px"></div>
      </body>
    </html>
    To obtain the required map in the HTML page I have implemented the same google URL parameter type "?q=". This simplifies the query construction from within the A5V9 form design supercontrol genie

    This is achiveid by the following javascript function:
    HTML Code:
    <script type="text/javascript">
     
      function gup( name )
     {
      name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); 
     var regexS = "[\\?&]"+name+"=([^&#]*)"; 
     var regex = new RegExp( regexS ); 
     var results = regex.exec( window.location.href );
      if( results == null )    return "";  else    return results[1];
     }
    The varariable is referenced as "q_param" and if no error occurs it produces the required geocoder call string.

    Limitations:
    The image div container can only be defined in pixels and not "%" so it requires some tweaking to obtain the required image size for the the form element in question . Take into account window size, Anchor points, Screen Size and resolution.

    The API key is relative so always request root domain address i.e http"//somewhere.com and not was.somewhere.com. The geocoder request calls are currently restricted to 25000 request per key per day.
    On this note it would be wise to tweak the API to return the geocoder info one time for each address and then store this info as a character string in the same datatable as used in the application to show the maps.

    A function could be written to obtain all the required geostats required and then as layed out in the API Documentation (Very well layed out and simple to follow)be returned in a single file format which could be parsed accordingly and stored the A5V9 table field. Later any map requests could be used using the relevant geostat paramenters which greatly reduces the network overhead to obtain the map.



    Further Improvements:

    The API is rich in fuctionality and can allow many customisations such as local searches from within the map image and also layers which can produce numerous effects such as route layouts and radial searches, tag inclusions and cached results .


    All in all it was a pleasure researching this "tweak", mainly due to the documentation that is readily available. Don't any of you think that I am "WEB GEEK" I normally avoid coding of this type .
    Last edited by christobal; 05-17-2008, 01:03 AM.
    �There is nothing like a dream to create the future.�
    But then again:
    Basic research is what I am doing when I don't know what I am doing and to steal ideas from one person is plagiarism; to steal from many is research!

    #2
    Re: Google map Api and V9 Web Content Super Control

    Keith has made me aware of an error within the user defined template (maybe a bug!). Here is a workaround : see attached zip contents

    In super control genie paste the contents of expression.txt into the expression dialog whilst editing user defined template Chris
    �There is nothing like a dream to create the future.�
    But then again:
    Basic research is what I am doing when I don't know what I am doing and to steal ideas from one person is plagiarism; to steal from many is research!

    Comment


      #3
      Re: Google map Api and V9 Web Content Super Control

      Chris,

      I think the problem is that the user defined super control template is stored in your Application Data\Alpha Software\Alpha Five Version 9\SupercontrolTemplates\WebURLs folder and this does not get copied when you zip up the database. This is not a problem if the the other person just runs the app. But as soon as an attempt is made to edit the super control Alpha looks for that template and can not find it.

      Even after setting up the template properly I still get an error going to your site. It can't find the address.
      Tim Kiebert
      Eagle Creek Citrus
      A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

      Comment


        #4
        Re: Google map Api and V9 Web Content Super Control

        Originally posted by Tim Kiebert View Post
        Chris,

        I think the problem is that the user defined super control template is stored in your Application Data\Alpha Software\Alpha Five Version 9\SupercontrolTemplates\WebURLs folder and this does not get copied when you zip up the database. This is not a problem if the the other person just runs the app. But as soon as an attempt is made to edit the super control Alpha looks for that template and can not find it.

        Even after setting up the template properly I still get an error going to your site. It can't find the address.
        Tim the Error message is part of the google api geocoder function. The Google Server doesn"t recognise the address string you used. Try the address directly at maps.google.com to see why.
        �There is nothing like a dream to create the future.�
        But then again:
        Basic research is what I am doing when I don't know what I am doing and to steal ideas from one person is plagiarism; to steal from many is research!

        Comment


          #5
          Re: Google map Api and V9 Web Content Super Control

          I am just using the addresses that are in the sample app you posted. I duplicated the form and edited the super control to use the built in googlemap template and it works fine. So the addresses are being found at

          "http://maps.google.com/maps?q="+Bill_Address_1-" "+Bill_Address_2-" "+Bill_City-" "+Bill_State_Region-" "+Bill_Postal_Code-" "+Bill_Country-""
          Which resolves to
          http://maps.google.com/maps?q=14 Washington Ave Apt 4. Natick MA 01760
          But not at
          "http://bellsinisrael.com/gmap.html?q="+Bill_Address_1-" "+Bill_Address_2-" "+Bill_City-" "+Bill_State_Region-" "+Bill_Postal_Code-" "+Bill_Country-""
          Which resolves to
          http://bellsinisrael.com/gmap.html?q=14 Washington Ave Apt 4. Natick MA 01760
          shrug they both look the same to me.
          Tim Kiebert
          Eagle Creek Citrus
          A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

          Comment


            #6
            Re: Google map Api and V9 Web Content Super Control

            TIM: I see no problem with the addresses see your map




            Here are some references regarding Addressing:

            eXtensible Name Language see: http://www.oasis-open.org/committees/ciq/ciq.shtml#6
            Fitting over 200 countries into a unified format is no easy task. Countries have
            very different address formats. Some use street names for addressing, others don't.
            Some use island names, others don't. The format must allow for all these different
            types of addresses while at the same time provide a consistent and easy to use format.
            There are different ways to model data, including hierarchical, relational and
            object-oriented. Address data is hierarchical in nature (a country has cities, a
            city has streets and a street has premises) so a hierarchical model is the most
            natural fit.
            The international standard XML (eXtensible Markup Language) is well suited to represent
            hierarchical data and has therefore been adopted for the actual implementation of the
            data model.
            This specification is designed to describe the address elements, not be specific about
            the formatting and presentation of the address. However, formatting at the higher
            -composite- levels is preserved since these are either a single string value or an
            ordered list of multiple strings. This is only considered a side effect at this
            time; there is no detailed specification of how to handle and preserve white space
            in these strings. In the Netherlands for example, it is customary to use double
            spacing between postal code and town on a single line, but naturally this only
            works with fixed-width fonts. New lines are made explicit by only defining
            composite elements at line-level.
            See :http://code.google.com/apis/maps/doc...html#Geocoding
            {
            "name": "1600 Amphitheatre Parkway, Mountain View, CA, USA",
            "Status": {
            "code": 200,
            "request": "geocode"
            },
            "Placemark": [
            {
            "address": "1600 Amphitheatre Pkwy, Mountain View, CA 94043, USA",
            "AddressDetails": {
            "Country": {
            "CountryNameCode": "US",
            "AdministrativeArea": {
            "AdministrativeAreaName": "CA",
            "SubAdministrativeArea": {
            "SubAdministrativeAreaName": "Santa Clara",
            "Locality": {
            "LocalityName": "Mountain View",
            "Thoroughfare": {
            "ThoroughfareName": "1600 Amphitheatre Pkwy"
            },
            "PostalCode": {
            "PostalCodeNumber": "94043"
            }
            }
            }
            }
            },
            "Accuracy": 8
            },
            "Point": {
            "coordinates": [-122.083739, 37.423021, 0]
            }
            }
            ]
            }
            To address the whitespace which is sometimes handled by the web browser as"%20". I have forced the expression string to pass the "+" symbol between fields so as to break up the single string level and force composite structured resolutions see:

            �There is nothing like a dream to create the future.�
            But then again:
            Basic research is what I am doing when I don't know what I am doing and to steal ideas from one person is plagiarism; to steal from many is research!

            Comment


              #7
              Re: Google map Api and V9 Web Content Super Control

              Chris,

              I finally got your site to display the map. I had to get rid of all the spaces. Including the ones with in the Address1 and Address2 fields. The expression I used for Address 1 is
              Code:
              Stritran(alltrim(Bill_Address_1)," ","+")
              I still did not need to do this for the google site?????
              Tim Kiebert
              Eagle Creek Citrus
              A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

              Comment


                #8
                Re: Google map Api and V9 Web Content Super Control

                Originally posted by Tim Kiebert View Post
                Chris,

                I finally got your site to display the map. I had to get rid of all the spaces. Including the ones with in the Address1 and Address2 fields. The expression I used for Address 1 is
                Code:
                Stritran(alltrim(Bill_Address_1)," ","+")
                I still did not need to do this for the google site?????
                My map is a basic interpretation of the google map API. I didn't suggest this as an alternative to a full implemtation of the code available (maps.google.com). Keith didnt want the full blown version due to form design issuses, I suggested the use of the map api to achieve this , others said it couldn't be done.
                Originally posted by Selwyn Rabins View Post
                you can't. google didn't design their map to do that. they also did not design their map to show scroll bars if the window is too small.

                you have to make sure the supercontrol on the form is sized to be big enough.
                I put this example together to prove otherwise.
                �There is nothing like a dream to create the future.�
                But then again:
                Basic research is what I am doing when I don't know what I am doing and to steal ideas from one person is plagiarism; to steal from many is research!

                Comment


                  #9
                  Re: Google map Api and V9 Web Content Super Control

                  Chris,

                  Don't get me wrong, I'm not complaining. I appreciate your contribution very much.

                  I was just trying to understand why one worked and the other didn't. And thought if I am having trouble some else might.

                  I'm also one to push the envelope and try things that 'can't be done'.
                  Last edited by Tim Kiebert; 05-18-2008, 06:30 AM.
                  Tim Kiebert
                  Eagle Creek Citrus
                  A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

                  Comment


                    #10
                    Re: Google map Api and V9 Web Content Super Control

                    Originally posted by Tim Kiebert View Post
                    Chris,

                    Don't get me wrong, I'm not complaining. I apprec
                    I didn't, I just wanted to reiterate the fact that using well documented procedures you can do almost! anything
                    �There is nothing like a dream to create the future.�
                    But then again:
                    Basic research is what I am doing when I don't know what I am doing and to steal ideas from one person is plagiarism; to steal from many is research!

                    Comment


                      #11
                      Re: Google map Api and V9 Web Content Super Control

                      Has anyone figured out how to plot multiple addresses on Google Maps and display them in a Super Control like this guy has done for Filemaker Pro?

                      http://fmcollective.com/2007/09/05/g...ple-addresses/

                      I know if it can be done in FMP it can be done better in A5, but this article and Google's API and PHP are way out of my league!

                      Comment


                        #12
                        Re: Google map Api and V9 Web Content Super Control

                        I just coded this out...See if it fits your needs. http://msgboard.alphasoftware.com/al...248#post468248

                        Comment


                          #13
                          Re: Google map Api and V9 Web Content Super Control

                          You can also set the zoom factor with the "z=?" set at the end. This works on the http address bar and probably works also in the javascript code.

                          Comment

                          Working...
                          X