Google Map display problem - Websphere

This is a discussion on Google Map display problem - Websphere ; Hi All, I am trying to show Google Map on jsr 168 portlet using Google Map API for that I developed sample html file which works perfectly and give me proper result after that I copied code and paste it ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Google Map display problem

  1. Google Map display problem

    Hi All,

    I am trying to show Google Map on jsr 168 portlet using Google Map API for that I developed sample html file which works perfectly and give me proper result after that I copied code and paste it in appropriate jsp file of jsr 168 portlet but when I see that page at that time I can't see whole map.

    I can see only some part of page... I don't know what's happening...

    Below is that code of jsp file...

    Can anyone please let me know why it is happening... I am also trying to attach screen shot of page...

    I will appreciate your help...

    Thanks,
    HJ

    -----------------------------------------------------------

    <DIV >
    <script src="http://maps.google.com/maps?file=api&v=2"
    type="text/javascript"></script>
    <body onunload="GUnload()">
    <div id="map" style="width: 650px; height: 390px"></div>
    <noscript><b>JavaScript must be enabled in order for you to use Google Maps.</b> </noscript>

    <script type="text/javascript">
    if (GBrowserIsCompatible()) {

    function createMarker(point,html) {
    var marker = new GMarker(point);
    GEvent.addListener(marker, "click", function() {
    marker.openInfoWindowHtml(html);
    });
    return marker;
    }

    // Display the map, with some controls and set the initial location
    var map = new GMap2(document.getElementById("map"));
    map.addControl(new GLargeMapControl());
    map.setCenter(new GLatLng(39.479395, 19.746094),1);

    // Set up three markers with info windows

    var point = new GLatLng(38.479395, 139.746094);
    var marker = createMarker(point,'Marker 1')

    map.addOverlay(marker);

    // Asia
    var point = new GLatLng(59.479395, 90.746094);
    var marker = createMarker(point,'abc')
    map.addOverlay(marker);

    }

    // display a warning if the browser was not compatible
    else {
    alert("Sorry, the Google Maps API is not compatible with this browser");
    }

    </script>
    </body>

    </DIV>
    -----------------------------------------------------------

  2. Re: Google Map display problem

    Hi HJ,

    did you ever found a solution to this problem? I am facing the same chalenge over here.

    Thnx Erik

  3. Re: Google Map display problem

    I solved it... I didn't passed height and width in Map tag instead of it I passed in constructor of GMap2... You just have do that and it will solve your problem. Below is example of it...


    ....

    // Display the map, with some controls and set the initial location
    var map = new GMap2(document.getElementById("map"), {size: new GSize(550,450)});//, gMapOptions);

    Cheers,
    HJ

  4. Re: Google Map display problem

    I have the same problem using Google Maps JSP Taglibrary.

    When I set the map size to be large the image of the map is painted partly.

    When I set the map size to be small it works properly, but the center point of the map is the left upper corner and not in the center.

    The same code works properly on application server.



    Is there any way to code the tld as the you solved the problem in Java Script?

+ Reply to Thread