Blogs

Prem Mascarenhas

Google Map Services for your Site/Portal
Prem Mascarenhas SAP Employee 
Business Card
Company: SAP Global Delivery
Posted on Dec. 11, 2007 01:22 AM in Enterprise Portal (EP), JavaScript

Subscribe.Subscribe
Print. Print
Permalink Permalink
Share

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.

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.

Prem Mascarenhas   is an SAP Enterprise Portal Development Consultant at SAP Global Delivery, Bangalore, India. He has worked on External Facing Light Framework Portals. His area of interest is Portal Content Development and Implementation and Business Process Modelling and Implementation.


Comment on this articleHope you liked this !! I really advise you to use it in your implementations..
Comment on this weblog
Showing messages 1 through 15 of 15.

Titles Only Main Topics Oldest First

  • Good blog.
    2007-12-17 01:43:27 Preksha Malhotra Business Card [Reply]

    Hey.
    That is a great blog. However, I am wondering if you could tell us how we can write this code in a JSPDynpage portal component.


    Regards,
    Preksha

    • Good blog.
      2007-12-18 22:57:42 Preksha Malhotra Business Card [Reply]

      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.

      • Good blog.
        2007-12-19 04:17:51 Prem Mascarenhas SAP Employee Business Card [Reply]

        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.

  • Nice article
    2007-12-12 04:12:28 AbyJacob Emmanuel Business Card [Reply]

    Hi Prem,


    Very nice article.


    Regards,
    AbyJ

    • Nice article
      2007-12-12 04:20:36 Prem Mascarenhas SAP Employee Business Card [Reply]

      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.
  • Easy and useful
    2007-12-11 13:23:37 Ibrahim Gunduz SAP Employee Business Card [Reply]

    Thanks a lot.
    • Easy and useful
      2007-12-12 04:20:53 Prem Mascarenhas SAP Employee Business Card [Reply]

      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.
      • Easy and useful
        2007-12-19 22:43:24 Michael Nicholls SAP Employee Business Card [Reply]

        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

        • Easy and useful
          2007-12-21 01:36:37 Michael Nicholls SAP Employee Business Card [Reply]

          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!

          • Easy and useful
            2008-05-02 04:15:12 Ashish Shah Business Card [Reply]

            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


Showing messages 1 through 15 of 15.