include google map function in .jsp

4 messages Options
Embed this post
Permalink
maker su

include google map function in .jsp

Reply Threaded More More options
Print post
Permalink
Hi All,
I create map.jsp for show google map but not work.
Please hint.
Thanks,
Maker su
 
 
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>Google Maps JavaScript API Example: Simple Map</title>
    <script src="http://maps.google.com/maps?file=api&amp;v=2.x&amp;sensor=false&amp;key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA"
            type="text/javascript"></script>
    <script type="text/javascript">
    function initialize() {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map_canvas"));
        map.setCenter(new GLatLng(37.4419, -122.1419), 13);
        map.setUIToDefault();
      }
    }
    </script>
  </head>
  <body onload="initialize()" onunload="GUnload()">
    <div id="map_canvas" style="width: 500px; height: 300px"></div>
  </body>
maker su

Re: include google map function in .jsp

Reply Threaded More More options
Print post
Permalink
Hi All,
The result of body will not contain onload="initialize()" and onunload="GUnload()".
So use window.onload instead.
Have to study the javascript mechanism of appfuse.
BR,
Maker Su
 
 
//
 <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>Google Maps JavaScript API Example: Simple Map</title>
    <script src="http://maps.google.com/maps?file=api&amp;v=2.x&amp;sensor=false&amp;key=0rpoKs1udadoRLWny7gLqC9NNS3Pf0CSMKeiH8g"
            type="text/javascript"></script>
    <script type="text/javascript">
    window.onload = function() {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map_canvas"));
        map.setCenter(new GLatLng(37.4419, -122.1419), 13);
        map.setUIToDefault();
      }
    }
    </script>
  </head>
    <div id="map_canvas" style="width: 500px; height: 300px"></div>


 
On Thu, Mar 12, 2009 at 4:45 PM, maker su <[hidden email]> wrote:
Hi All,
I create map.jsp for show google map but not work.
Please hint.
Thanks,
Maker su
 
 
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>Google Maps JavaScript API Example: Simple Map</title>
    <script src="http://maps.google.com/maps?file=api&amp;v=2.x&amp;sensor=false&amp;key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA"
            type="text/javascript"></script>
    <script type="text/javascript">
    function initialize() {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map_canvas"));
        map.setCenter(new GLatLng(37.4419, -122.1419), 13);
        map.setUIToDefault();
      }
    }
    </script>
  </head>
  <body onload="initialize()" onunload="GUnload()">
    <div id="map_canvas" style="width: 500px; height: 300px"></div>
  </body>

tonylu880042

Re: include google map function in .jsp

Reply Threaded More More options
Print post
Permalink
Hi Marker,
 Try to update you default.jsp with following decorator statement.
 <body <decorator:getProperty property="body.onload" writeEntireProperty="true" /> >
 than I bet your problem will be gone,
Best regards,
tony
http://tony880042.blogspot.com

maker su wrote:
Hi All,
The result of body will not contain onload="initialize()" and
onunload="GUnload()".
So use window.onload instead.
Have to study the javascript mechanism of appfuse.
BR,
Maker Su


//
 <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>Google Maps JavaScript API Example: Simple Map</title>
    <script src="
http://maps.google.com/maps?file=api&v=2.x&sensor=false&key=0rpoKs1udadoRLWny7gLqC9NNS3Pf0CSMKeiH8g
"
            type="text/javascript"></script>
    <script type="text/javascript">
    window.onload = function() {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map_canvas"));
        map.setCenter(new GLatLng(37.4419, -122.1419), 13);
        map.setUIToDefault();
      }
    }
    </script>
  </head>
    <div id="map_canvas" style="width: 500px; height: 300px"></div>



On Thu, Mar 12, 2009 at 4:45 PM, maker su <makersu@gmail.com> wrote:

> Hi All,
> I create map.jsp for show google map but not work.
> Please hint.
> Thanks,
> Maker su
>
> // from
> http://code.google.com/intl/zh-TW/apis/maps/documentation/examples/map-simple.html
>
> <head>
>     <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
>     <title>Google Maps JavaScript API Example: Simple Map</title>
>     <script src="
> http://maps.google.com/maps?file=api&v=2.x&sensor=false&key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA<http://maps.google.com/maps?file=api&v=2.x&sensor=false&key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA>
> "
>             type="text/javascript"></script>
>     <script type="text/javascript">
>     function initialize() {
>       if (GBrowserIsCompatible()) {
>         var map = new GMap2(document.getElementById("map_canvas"));
>         map.setCenter(new GLatLng(37.4419, -122.1419), 13);
>         map.setUIToDefault();
>       }
>     }
>     </script>
>   </head>
>   <body onload="initialize()" onunload="GUnload()">
>     <div id="map_canvas" style="width: 500px; height: 300px"></div>
>   </body>
>
roberto.cr

Re: include google map function in .jsp

Reply Threaded More More options
Print post
Permalink
In reply to this post by maker su
thank you! i've been beating my head on the wall for hours because of this... now my site work on stupid IE6
window.onload="initialize()" instead os simple onload="initialize()"
ive just registered to bump this on google
GBrowserIsCompatible() Object expected error in Internet Explorer 6
IE6 google maps problem

maker su wrote:
Hi All,
The result of body will not contain onload="initialize()" and
onunload="GUnload()".
So use window.onload instead.
Have to study the javascript mechanism of appfuse.
BR,
Maker Su


//
 <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>Google Maps JavaScript API Example: Simple Map</title>
    <script src="
http://maps.google.com/maps?file=api&v=2.x&sensor=false&key=0rpoKs1udadoRLWny7gLqC9NNS3Pf0CSMKeiH8g
"
            type="text/javascript"></script>
    <script type="text/javascript">
    window.onload = function() {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map_canvas"));
        map.setCenter(new GLatLng(37.4419, -122.1419), 13);
        map.setUIToDefault();
      }
    }
    </script>
  </head>
    <div id="map_canvas" style="width: 500px; height: 300px"></div>



On Thu, Mar 12, 2009 at 4:45 PM, maker su <makersu@gmail.com> wrote:

> Hi All,
> I create map.jsp for show google map but not work.
> Please hint.
> Thanks,
> Maker su
>
> // from
> http://code.google.com/intl/zh-TW/apis/maps/documentation/examples/map-simple.html
>
> <head>
>     <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
>     <title>Google Maps JavaScript API Example: Simple Map</title>
>     <script src="
> http://maps.google.com/maps?file=api&v=2.x&sensor=false&key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA<http://maps.google.com/maps?file=api&v=2.x&sensor=false&key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA>
> "
>             type="text/javascript"></script>
>     <script type="text/javascript">
>     function initialize() {
>       if (GBrowserIsCompatible()) {
>         var map = new GMap2(document.getElementById("map_canvas"));
>         map.setCenter(new GLatLng(37.4419, -122.1419), 13);
>         map.setUIToDefault();
>       }
>     }
>     </script>
>   </head>
>   <body onload="initialize()" onunload="GUnload()">
>     <div id="map_canvas" style="width: 500px; height: 300px"></div>
>   </body>
>