Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 915135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T17:50:12+00:00 2026-05-15T17:50:12+00:00

here is my code – I’ve tried using the google maps api and other

  • 0

here is my code – I’ve tried using the google maps api and other tutorials, but I can’t seem to get the code right. It either displays the default icon or no icon at all.

Here is the unaltered code –

                        <script type="text/javascript">
                    //<![CDATA[

                    <?php if ($er_imglayout == 4 && $row->image2) { ?>
                        function domap()
                    <?php } else { ?>
                        function ezrealtymap()
                    <?php } ?>
                    {
                        // Check to see if this browser can run the Google API
                        if (GBrowserIsCompatible()) {

                            gmarkers = [];
                            htmls = [];
                            to_htmls = [];
                            from_htmls = [];
                            i=0;


                            // Display the map, with some controls and set the initial location 
                            var map = new GMap2(document.getElementById("map"));
                            map.addControl(new GLargeMapControl());
                            map.addControl(new GMapTypeControl());
                            map.setCenter(new GLatLng( <?php echo $row->declat;?>,<?php echo $row->declong;?>), <?php echo $er_mapres;?>);
                            map.setMapType(<?php echo $er_mapview;?>);

                            // Set up three markers with info windows 

                            var point = new GLatLng( <?php echo $row->declat;?>,<?php echo $row->declong;?>);
                            var marker = createMarker(point,"<?php echo stripslashes($row->adline);?>","<?php echo stripslashes($row->adline);?>")
                            map.addOverlay(marker);

                        } else {

                            // display a warning if the browser was not compatible

                            alert("<?php echo _EZREALTY_MAPPING_INCOMPATIBLE;?>");
                        }
                    }

                    // This Javascript is based on code provided by the
                    // Blackpool Community Church Javascript Team
                    // http://www.commchurch.freeserve.co.uk/   
                    // http://www.econym.demon.co.uk/googlemaps/

                    //]]>

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

                    function createMarker(point,name,html) {
                        var marker = new GMarker(point);

                        // The info window version with the "to here" form open

                        to_htmls[i] = html + '<br /><?php echo _EZREALTY_MAP_DIRECTIONS;?>: <strong><?php echo _EZREALTY_MAP_TOHERE;?></strong> - <a href="javascript:fromhere(' + i + ')"><?php echo _EZREALTY_MAP_FROMHERE;?></a>' +
                        '<br /><?php echo _EZREALTY_MAP_START;?>:<form action="http://maps.google.com/maps" method="get" target="_blank">' +
                        '<input type="text" size="40" maxlength="40" name="saddr" id="saddr" value="" /><br />' +
                        '<input value="<?php echo _EZREALTY_MAP_DIRECTIONS;?>" type="submit">' +
                        '<input type="hidden" name="daddr" value="' + point.lat() + ',' + point.lng() + 
                        // "(" + name + ")" + 
                        '"/>';

                        // The info window version with the "to here" form open

                        from_htmls[i] = html + '<br /><?php echo _EZREALTY_MAP_DIRECTIONS;?>: <a href="javascript:tohere(' + i + ')"><?php echo _EZREALTY_MAP_TOHERE;?></a> - <strong><?php echo _EZREALTY_MAP_FROMHERE;?></strong>' +
                        '<br /><?php echo _EZREALTY_MAP_END;?>:<form action="http://maps.google.com/maps" method="get"" target="_blank">' +
                        '<input type="text" size="40" maxlength="40" name="daddr" id="daddr" value="" /><br />' +
                        '<input value="<?php echo _EZREALTY_MAP_DIRECTIONS;?>" type="submit">' +
                        '<input type="hidden" name="saddr" value="' + point.lat() + ',' + point.lng() +
                        // "(" + name + ")" + 
                        '"/>';

                        // The inactive version of the direction info

                        html = html + '<br /><?php echo _EZREALTY_MAP_DIRECTIONS;?>: <a href="javascript:tohere('+i+')"><?php echo _EZREALTY_MAP_TOHERE;?></a> - <a href="javascript:fromhere('+i+')"><?php echo _EZREALTY_MAP_FROMHERE;?></a>';

                        GEvent.addListener(marker, "click", function() {
                            marker.openInfoWindowHtml(html);
                        });
                        gmarkers[i] = marker;
                        htmls[i] = html;
                        i++;
                        return marker;
                    }

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

                    </script>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T17:50:12+00:00Added an answer on May 15, 2026 at 5:50 pm

    Humm sorry – now I understand. I guess you’re missing a part of the marker generation process. This is how I create custom markers and add them to the map.

    var niceIcon = new GIcon();
    niceIcon.image = '/images/Maps/icon/image.png';
    niceIcon.shadow = '/images/Maps/icon/shadow.png';
    niceIcon.iconSize = new GSize(34, 38);
    niceIcon.shadowSize = new GSize(53, 38);
    niceIcon.iconAnchor = new GPoint(0, 38);
    niceIcon.infoWindowAnchor = new GPoint(17, 0);
    niceIcon.printImage = '/images/Maps/icon/printImage.gif';
    niceIcon.mozPrintImage = '/images/Maps/icon/mozPrintImage.gif';
    niceIcon.printShadow = '/images/Maps/icon/printShadow.gif';
    niceIcon.transparent = '/images/Maps/icon/transparent.png';
    niceIcon.imageMap = [27, 0, 27, 1, 27, 2, 27, 3, 27, 4, 27, 5, 27, 6, 27, 7, 27, 8, 27, 9, 27, 10, 27, 11, 27, 12, 27, 13, 27, 14, 27, 15, 27, 16, 27, 17, 27, 18, 27, 19, 27, 20, 33, 21, 33, 22, 33, 23, 33, 24, 32, 25, 32, 26, 31, 27, 30, 28, 31, 29, 30, 30, 30, 31, 17, 32, 19, 33, 18, 34, 15, 35, 15, 36, 14, 37, 13, 37, 13, 36, 12, 35, 11, 34, 11, 33, 10, 32, 3, 31, 3, 30, 3, 29, 3, 28, 0, 27, 0, 26, 0, 25, 0, 24, 0, 23, 0, 22, 0, 21, 0, 20, 0, 19, 0, 18, 0, 17, 0, 16, 0, 15, 0, 14, 0, 13, 0, 12, 0, 11, 0, 10, 0, 9, 0, 8, 0, 7, 0, 6, 0, 5, 0, 4, 0, 3, 0, 2, 0, 1, 0, 0];
    
    var markerOptions = { icon: niceIcon };
    
    var point = new GLatLng(lat, lon);
    var marker = new GMarker(point, markerOptions);
    map.addOverlay(marker);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have been using google AJAX API loader (to get the location of a
Here code of my project. I use direct Tcp connection But i get Could
here is code for regular expression matching #include<iostream> #include<stdio.h> #include<string.h> using namespace std; int
My code here works fine to get the content length, and tells me how
enter code here Want to remove items from a Main list , but give
I need code example please.i tried selectedindexchange but it doesnot register any index change
I have tried this query to get the duplicate records.but I am getting this
I am trying to use one-time passwords that can be generated using Google Authenticator
The script is on jsfiddle here : CODE What it does at the moment
Ok the error is showing up somewhere in this here code if($error==false) { $query

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.