7 Replies Latest reply on Dec 8, 2012 10:26 AM by Sorbsbuster

    Multiple Pins in Web Viewer

    MediaSmith

      Title

      Multiple Pins in Web Viewer

      Post

      I have a solution that uses the web viewer to display the location of properties.  I've been using it one at a time.  Now they want to see all properties that are managed and assigned to a particular office.  There are several offices.

      The Web Viewer setup page ( I am using Google) allows me to insert fields and that works fine for "one at a time" viewing.  It also gives me the option to insert a calculated field for each parameter.  Tech Support suggests the following syntax:

      "http://local.google.com/maps?" & "q=" & /*Address=*/ Untitled::Address & "," & /*City=*/ Untitled::City & "," & /*State=*/ Untitled::State & "," & Untitled::Address 1 & "," & Untitled::City_1  &  ","  &  Untitled::State_1

      This produces a starting point and and a pin (a green arrow and a red pin).  Map Quest is also supported on the setup page with the same parameters.  

      Since these properties will change without notice, both in number and in location, I would like to use something that will calculate automatically as the file changes.  I guess I could build it with a script but it sounds very slow.

      Any suggestions?

        • 1. Re: Multiple Pins in Web Viewer
          Sorbsbuster

          We use the same feature for displaying a route.  We use a script to build the syntax describing that route, then go to the web viewer page and display it.  It is not slow for FM to do, and a route is more time-consuming that a list of points, presumably.  Also, the time will be dictated by the speed of your connection to Google, I suspect, not the speed of FM's script execution.

          You can also make the script run automatically on loading the web viewer layout.

          • 2. Re: Multiple Pins in Web Viewer
            MediaSmith

            Thanks for the info Sorbsbuster.  Are you using the same syntax that I described above?

            • 3. Re: Multiple Pins in Web Viewer
              Sorbsbuster

              For route planning I use a looping script.  It sets the starting point as a variable, $GoogleDirections:

              "http://maps.google.co.uk/maps?f=d&hl=en&saddr=" &

              //Initial Address
              rota_Clients::ClientAddressNumber & "+" & rota_Clients::ClientAddressLine1 & "+" & rota_Clients::ClientAddressPostCodeFull

              & "&daddr="

              and then loops through adding more locations with this step:


              $GoogleDirections &

              //Destination Address
              rota_Clients::ClientAddressNumber & "+" & rota_Clients::ClientAddressLine1 & "+" & rota_Clients::ClientAddressPostCodeFull

              • 4. Re: Multiple Pins in Web Viewer
                WillRetherford

                     I am trying to react your step by step move Sorbsbuster, but I am having some problems. Can you repeat these steps step by step as specific as possible?

                • 5. Re: Multiple Pins in Web Viewer
                  Sorbsbuster

                       Sorry if this doesn't scan correctly.  We have other steps before and after these steps that check, for example, if GoogleMaps can handle the total number of destinations, or whether it needs to be split into two sections.  (If it needs 3 sections we reckon they'll get lost after 56 different destinations...)  So I had to try and extract just the part that builds the journey.  (For PostCode read ZipCode if you are in the US.)

                         
                  •            
                  •      
                  •            
                  •      
                  •           #
                  •      
                  •           #Now build the first batch destination list
                  •      
                  •           #
                  •      
                  •           Sort Records [ Specified Sort Order: [Call the field you want to sort the destination sequence by]; ascending ] [ Restore; No dialog ]
                  •      
                  •           #
                  •      
                  •           #Build the first two addresses
                  •      
                  •           Go to Record/Request/Page [ First ]
                  •      
                  •           Set Variable [ $GoogleDirections; Value:"http://maps.google.co.uk/maps?f=d&hl=en&saddr=" & //Initial Address ClientAddressNumber & "+" & ClientAddressLine1 & "+" & ClientAddressPostCodeFull & "&daddr=" ]
                  •      
                  •           Go to Record/Request/Page [ Next ]
                  •      
                  •           Set Variable [ $GoogleDirections; Value:$GoogleDirections & //Destination Address ClientAddressNumber & "+" & ClientAddressLine1 & "+" & ClientAddressPostCodeFull ]
                  •      
                  •           #
                  •      
                  •           #If more than two records, build rest of list by a loop
                  •      
                  •           If [ Get ( FoundCount ) > 2 ]
                  •      
                  •           Loop
                  •      
                  •           Go to Record/Request/Page [ Next; Exit after last ]
                  •      
                  •           Set Variable [ $GoogleDirections; Value:$GoogleDirections & "+to:" & //Next Destination Address ClientAddressNumber & "+" & ClientAddressLine1 & "+" & ClientAddressPostCodeFull ]
                  •      
                  •           End Loop
                  •      
                  •           End If
                  •      
                  •           #
                  •      
                  •           #
                  •      
                  •           #Trap the first destination list
                  •      
                  •           Set Field [ ROTA::gGoogleDirections; $GoogleDirections ]
                  •      
                  •           #
                  •      
                  •           #
                  • 6. Re: Multiple Pins in Web Viewer
                    WillRetherford

                         Okay, I figured out that it is a script.

                         My question is in the script how do  I set variable and value to google directions?

                    • 7. Re: Multiple Pins in Web Viewer
                      Sorbsbuster

                           You just replace the text I put in blue with your field names, such as the Client House Number, Client Address Line 1, etc

                           So: find all the addresses you want to go to, and sort them into the route sequence.  Then let the script run through each record from the top, and it will build up the URL in the format that GoogleMaps needs it.

                           Then have a webviewer with that variable set as its address (or use the Open URL step to see it in an separate browser).