2 Replies Latest reply on Nov 9, 2012 6:34 AM by nella

    Web Viewer

    nella

      I am using the contact starter solution.

      In the Web Viewer I have an issue with the postal code.

      This is the script:

      GetMap ( "Map1" ; 14 ; Contacts::Work Address 1 ; Contacts::Work Address 2 ; Contacts::Work City ; Contacts::Work State ; Contacts::Work Postal Code ; Contacts::Work Country )

       

      The map shows nicely until I put the postal code in the field, then it turns blue and doesn't display the map.

      It displays fine without the postal.

      Why is that?

        • 1. Re: Web Viewer
          Mike Duncan

          This looks like it uses a custom function to construct a URL for google maps. The only way I was able to duplicate your results was to enter an invalid address that it couldn't map, you can also hit the button to the right of the first address field to take you a web browser with that same address in google maps to see if you can get a more verbose description of why google maps couldn't find a match for you address.

           

          Here's the custom function, fyi:

          Let     (
              [
              address =   Substitute  (
                                      address1 & " " &
                                      address2 & " " &
                                      city & " " &
                                      state & " " &
                                      postalCode & " " &
                                      country ;
                                      " " ; "+"
                                      ) ;
              size =      GetLayoutObjectAttribute ( webViewerName ; "width" ) & "x" & GetLayoutObjectAttribute ( webViewerName ; "height" )
              ] ;

           

              "http://maps.google.com/maps/api/staticmap?center="
                      & address &
                          "&zoom=" & zoom &
                              "&markers="
                                  & address &
                                      "&size="
                                          & size &
                                              "&sensor=false"
              )

           

          *edited for formatting

          • 2. Re: Web Viewer
            nella

            Clicking the button to the right of the first address field works fine.

            Also, the viewer in the second tab (Home Address) works fine as well.

            The existing scripts are just about identical except one says home and the other says work.

            I copied the script from the home tab and pasted it into the work tab viewer, changed the  ( "Map2" ; to  ( "Map1" ; along with changing Home to Work and it still doesn't work.

            When I put the postal in the field and change the province to an incorrect one, the address displays correctly.

            Change the province to the correct one and it will not display the map.

             

             

            This one works:

            GetMap ( "Map2" ; 14 ; Contacts::Home_Address_1 ; Contacts::Home_Address_2 ; Contacts::Home_City ; Contacts::Home_State ; Contacts::Home_Postal_Code ; Contacts::Home_Country )

             

            This one does not:

            GetMap ( "Map1" ; 14 ; Contacts::Work_Address_1 ; Contacts::Work_Address_2 ; Contacts::Work_City ; Contacts::Work_Prov_State ; Contacts::Work_Postal_Code ; Contacts::Work_Country )

             

            I changed the Map1'' to Map2'' and it works fine.