Announcement

Collapse
No announcement yet.

Clientscript und Google Map

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Clientscript und Google Map

    Alright after 5 hours trying to fix that error on my page, i give up...

    I found out that is these file: yahoo-dom-event.js, if I removed from the headinclude my map works.

    I wrote this javascript to show the google map in the profile, this is the code

    PHP Code:
    <script type="text/javascript">
    //<![CDATA[
          
    function get_icon(type) {
            var 
    color;
            if ((
    typeof(type)=="undefined") || (type==null))
            {
            
    color "red"
            
    }
            else {
            
    color type
            
    }
            var 
    icon = new GIcon();
            
    icon.image "../img/map/wm_"color +".png";
            
    icon.shadow "../img/map/wm_shadow.png";
            
    icon.iconSize = new GSize(1220);
            
    icon.shadowSize = new GSize(2220);
            
    icon.iconAnchor = new GLatLng(202);
            
    icon.infoWindowAnchor = new GLatLng(15);
            return 
    icon;

          }


          function 
    addNewPoint(spotlink_spottitlecitystatelnglattype) {
            var 
    point = new GLatLng(lat,lng);
            var 
    icon get_icon(type);
            var 
    marker = new GMarker(pointicon);
            
            
    title2 '<a href="/spot_'spot +'_'link_spot +'.html">'title +'</a>';


            var 
    content '<div align="left"><div width="200">'title2 '</div><table width="200"><tr><td width="50px" align="left" valign="top">Details</td></tr><tr><td align="left" valign="top">State</TD><TD align="left" valign="top"><div class="wmtext" align="left" style="width:auto">' state '</div></td></tr><tr><td width="50px" align="left" valign="top">City</td><td align="left" valign="top">' city '</div></td></tr></table></div></div>';


            var 
    infoTabs = [
              new 
    GInfoWindowTab("Details"content)
                ];

            
    GEvent.addListener(marker"click", function() {
            
    marker.openInfoWindowTabsHtml(infoTabs);
              });

            
    usermap.addOverlay(marker);

          }

          var 
    usermap;
          var 
    dlat "-10.487811882056683";
          var 
    dlng "107.578125";
          var 
    dzoom "4";
          var 
    dtypemap "c";
          var 
    markers;
          var 
    i=0;
          var 
    timeOut 10;


          function 
    initialize() {
    usermap = new GMap2(document.getElementById("user_map_10"),{mapTypes:[G_NORMAL_MAP,G_SATELLITE_MAP,G_HYBRID_MAP]});
            
    usermap.addControl(new GLargeMapControl());
            
    usermap.addControl(new GMapTypeControl());
            
    usermap.setCenter(new GLatLng(-10.487811882056683,107.578125),4);


            
    GEvent.addListener(usermap"moveend", function() {
                var 
    center usermap.getCenter();
                var 
    latLngStr '(' center.', ' center.')';

            });



            
    usermap.setCenter(new GLatLng(dlat,dlng),dzoom);
            var 
    request GXmlHttp.create();
            
    request.open("GET""spotsmarkers.php?u=<phrase>$prepared[userid]</phrase>"true);
            
    request.onreadystatechange = function() {
              if (
    request.readyState == 4) {
                var 
    xmlDoc request.responseXML;
                
    markers xmlDoc.documentElement.getElementsByTagName("marker");
                
    window.setTimeout(usermapOne,timeOut);
                
              } else {
                
    //alert(request.readyState);
              
    }
            }
            
    request.send(null);
          }

          function 
    usermapOne() {
            
    //document.getElementById('counter').innerHTML = i + " / " + markers.length;
            
    if ( markers.length ) {
              
    addNewPoint(
              
    parseFloat(markers[i].getAttribute("spot")),
              
    markers[i].getAttribute("link_spot"),
              
    markers[i].getAttribute("title"),
              
    markers[i].getAttribute("city"),
              
    markers[i].getAttribute("state"),
              
    parseFloat(markers[i].getAttribute("lng")),
              
    parseFloat(markers[i].getAttribute("lat")),
              
    markers[i].getAttribute("type")
              
              );
              
    i++;
              
    window.setTimeout(usermapOne,timeOut);
            }
          }
    //]]
                   
    </script
    My question is now, what is the conflict with the yahoo-dom file?

    Thank you for help
    Jérôme

    The example will be found here: http://www.next89.com/forum/members/enclave.html
    Conten Management System -> http://www.jakcms.com
    Kitesspots around the world -> http://www.endlesswind.com
    All we do is programming ->http://www.jakweb.ch

  • #2
    We can't offer custom coding support, so can cannot help you debug the conflict. Sorry. Please check over on vbulletin.org, maybe someone experienced with custom coding and hacking can be of better help for you on that one.
    Best Regards,
    Andy Huang

    Comment


    • #3
      I found out what the problem is:

      - getElementById
      - addListener

      I found now another solution.

      Thank you anyway
      Jérôme
      Conten Management System -> http://www.jakcms.com
      Kitesspots around the world -> http://www.endlesswind.com
      All we do is programming ->http://www.jakweb.ch

      Comment

      widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
      Working...
      X