Skip to Content

I love traveling. In fact if I’m not physically traveling, I’m Armchair traveling. This is probably the reason why I can ponder over an Atlas and nowadays Google Earth for maybe over an hour. Google Earth is one of the coolest inventions, and its Great. I mean, my friends and I have visited places after doing a thorough look up of the place on Google Earth. For your browser, there’s Google Maps. And if you still want more, there’s Google’s Map API released as a Web service. Many a cool site has used it.

 

Its so easy to get lost in a bustling city with similar roads. Thats probably why people provide you with birds eye view maps to get a better understanding. With Google Maps you not only get that, but you get it in real life images. It would be really great if company’s web sites showing their locations with addresses could also give you that snapshot of the place and its surroundings and approaching roads from above especially if you wish to go there and visit them.

 

I’ll give you an example. Of course you would point these links at your office locations !!

 

You could probably start with a start page showing the locations like this:

 

image 

When you click on any of the locations, the map is shown below with a brief description at that point.

  image
image

The application is very simple to build. Google’s API’s and references are readily available. I’ll post this script for you.

But first, if you intend to use this, you have to sign up for a Google Map API Key from here: http://code.google.com/apis/maps/. You can then use the key in the application below.

Troy | Stonehenge | Great Wall of China | Sphinx

Now this application is a simple HTML with JavaScript. You could use it in a Portal Application Project. Create a JSP as a stand alone resource, place the code there and proceed to make an iView out of the resultant PAR file.

Typically a corporate portal might have its office locations listed on a page where you could create this scenario. Its also ideal for an external facing anonymous based portal. Thats a more common scenario.

To report this post you need to login first.

16 Comments

You must be Logged on to comment or reply to a post.

    1. Prem Mascarenhas Post author
      Thank you all for your comments. I’d really want you to try out more. There are myriad methods available under the API, including directions. Its fantastic.
      (0) 
      1. Michael Nicholls
        I built a portal component that stores details of where our team members are working this week and then a standalone J2EE web app that display this information as a Google map.

        The component is based on the PageProcessorComponent and allows for the user to select their location on a map and return the appropriate coordinates through the Geocoder service.

        Please note that the key you use seems to be based on the FQDN of the portal server.

        Cheers

        (0) 
        1. Michael Nicholls
          The attached SAPmats link contains a zipped version of the portal component and a J2EE app that can be used to show the team locator functionality.
          Please note that the key in the Store.java file in the PAR file and in the People.jsp file will only work on one of our SAP internal systems. You will need to replace it with the one you get from Google.

          The SAPmats file location is: https://sapmats-de.sap-ag.de/download/download.cgi?id=QHPCB7NLLN5TNWKFH429MGPUBMNDURCVLXW38MEWVZ3ZQP7J4E . It will be there until the end of February 2008.
          The application to store values is invoked with http://hostname:port/irj/servlet/prt/portal/prtroot/CourseInfo.Store?people  and to view the results use http://hostname:port/LocalDevelopment~mapwar~sap.com/People.jsp

          Good luck!

          (0) 
          1. Ashish Shah
            Hi Michael,

            Can you please pass on the zipped version of the portal component and a j2ee app to me??
            I saw that the SAPmats file had expired in Feb 2008.But is it possible for you to share those with me ?? Appreciate your help.

            Regards,
            Ashish Shah

            (0) 
    1. Prem Mascarenhas Post author
      Thank you all for your comments. I’d really want you to try out more. There are myriad methods available under the API, including directions. Its fantastic.
      (0) 
    1. Preksha Malhotra
      Hi Prem,

      I tried calling these APIs in an Abstract Portal Component. However, the map does not come up. And later i found out that Google Map APIs cannot be used in servers with URLs of type http://host1.mycompany.com/mysite.
      And the portal requires fully qualified host names.
      Was wondering if you have a work around.

      Regards,
      Preksha.

      (0) 
      1. Prem Mascarenhas Post author
        Hello Preksha,

        Thanks for your comments. Yes you can use it in a JSP Dynpage component.
        Are you sure about that because I tried it out on my portal and it worked just fine. I used a component type = JSP, not an abstract portal component, but that really does’nt matter.
        Anyways I’ll check with an FQDN and let you know.

        (0) 

Leave a Reply