Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • beastmode54 JA JobBoard
    #123610

    I am developing a real estate site, and i use soem mapping code. The code works fine on other templates….but on this template it does not…any ideas?

    Menalto Friend
    #232253

    From where and whats the problem?
    Be as specific as you can, to say it dont work doesnt help much

    beastmode54 JA JobBoard
    #232254

    Here is the chunk of code….the first part of the code is inserted just before the closing tag.. Please bar with me..i very very new at this

    <?php
    require( $mosConfig_absolute_path . “/administrator/components/com_ezrealty/config.ezrealty.php” );
    global $er_mapapi, $er_usemap, $er_mapsys;
    ?>

    <?php if ($er_usemap) { ?>

    <?php if ( $er_mapsys == 1 ){ ?>

    <script src=”http://maps.google.com/maps?file=api&v=2.x&key=<?php echo $er_mapapi;?>” type=”text/javascript”></script>
    <script type=”text/javascript”>
    //<!;
    var htmls = [];
    var to_htmls = [];
    var from_htmls = [];
    var i = 0;
    var baseIcon = new GIcon();
    baseIcon.iconSize=new GSize(32,32);
    baseIcon.shadowSize=new GSize(56,32);
    baseIcon.iconAnchor=new GPoint(16,32);
    baseIcon.infoWindowAnchor=new GPoint(16,0);

    var forsale = new GIcon(baseIcon, “http://maps.google.com/mapfiles/kml/pal3/icon31.png”, null, “http://maps.google.com/mapfiles/kml/pal3/icon31s.png”);

    // A function to create the marker and set up the event window

    function createMarker(point, address, icon)
    {
    var marker = new GMarker(point, icon);

    // The info window version with the “to here” form open

    to_htmls = ‘<div style=”font-family: Verdana, Arial, Helvetica, sans-serif; margin-bottom: 5px;”>’ +
    ‘<div style=”margin-bottom: 8px;”><strong>Address:</strong><br />’ + address + ‘</div>’ +
    ‘<strong>Get Directions:</strong> To here – <a href=”javascript:fromhere(‘ + i + ‘)”>From here</a><br />’ +
    ‘<span style=”font-size: 10px; color: #999999;”>Start Address:</span>’ +
    ‘<form target=”_blank” action=”http://maps.google.com/maps” method=”get”>’ +
    ‘<input type=”text” name=”saddr” id=”saddr” value=”” />’ +
    ‘<input type=”submit” value=”Go” />’ +
    ‘<input type=”hidden” name=”daddr” value=”‘ + address + ‘” />’ +
    ‘<input type=”hidden” name=”hl” value=”en” /></form></div>’;

    // The info window version with the “to here” form open

    from_htmls = ‘<div style=”font-family: Verdana, Arial, Helvetica, sans-serif; margin-bottom: 5px;”>’ +
    ‘<div style=”margin-bottom: 8px;”><strong>Address:</strong><br />’ + address + ‘</div>’ +
    ‘<strong>Get Directions:</strong> <a href=”javascript:tohere(‘ + i + ‘)”>To here</a> – From here<br />’ +
    ‘<span style=”font-size: 10px; color: #999999;”>End Address:</span>’ +
    ‘<form target=”_blank” action=”http://maps.google.com/maps” method=”get”>’ +
    ‘<input type=”text” name=”daddr” id=”daddr” value=”” />’ +
    ‘<input type=”submit” value=”Go” />’ +
    ‘<input type=”hidden” name=”saddr” value=”‘ + address + ‘” />’ +
    ‘<input type=”hidden” name=”hl” value=”en” /></form></div>’;

    // The inactive version of the direction info

    html = ‘<div style=”font-family: Verdana, Arial, Helvetica, sans-serif; margin-bottom: 5px;”>’ +
    ‘<div style=”margin-bottom: 8px;”><strong>Address:</strong><br />’ + address + ‘</div>’ +
    ‘<strong>Get Directions:</strong> <a href=”javascript:tohere(‘+i+’)”>To here</a> – <a href=”javascript:fromhere(‘+i+’)”>From here</a></div>’;

    GEvent.addListener(marker, “click”, function() {
    marker.openInfoWindowHtml(html);
    });

    gmarkers = marker;
    htmls = html;
    i++;
    return marker;
    }

    // functions that open the directions forms
    function tohere(i)
    {
    gmarkers.openInfoWindowHtml(to_htmls);
    }
    function fromhere(i)
    {
    gmarkers.openInfoWindowHtml(from_htmls);
    }

    function showAddress(address)
    {
    if (geocoder)
    {
    geocoder.getLatLng
    (
    address, function(point)
    {
    if (!point)
    {
    alert(address + ” not found”);
    }
    else
    {
    map.setCenter(point, 13);
    var marker = new GMarker(point, forsale);
    map.addOverlay(marker);
    map.addOverlay(createMarker(point, address, forsale));
    }
    }
    );
    }
    }

    //]]>
    </script>

    <?php } ?>

    <?php if ( $er_mapsys == 2 ){ ?>

    <script type=”text/javascript”
    src=”http://maps.yahooapis.com/v3.04/fl/javascript/apiloader.js?appid=<?php echo $er_mapapi;?>”>
    </script>
    <style type=”text/css”>
    #mapContainer {
    height: <?php echo $er_mapheight;?>px;
    width: <?php echo $er_mapwidth;?>px;
    }
    </style>

    <?php } ?>

    <?php } ?>

    </head>

    <BODY BGCOLOR=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 onload=”load()” onunload=”GUnload()”ONLOAD=”preloadImages();”>

    beastmode54 JA JobBoard
    #232255

    Thanks for your time…but i got it working….thanks!

Viewing 4 posts - 1 through 4 (of 4 total)

This topic contains 4 replies, has 2 voices, and was last updated by  beastmode54 16 years, 7 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum