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

  • Home
  • SEARCH
  • 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 8793325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:06:29+00:00 2026-06-13T23:06:29+00:00

I have successfully added a custom image for the marker on the google map.

  • 0

I have successfully added a custom image for the marker on the google map. The problem is such that the default marker that is balloon still appears along with the new image.

How should remove the default marker and only use the custom image?
The following is the code block that I have used :

    var image = "image url";   
    marker = createMarker(point, address1, town, postcode, SiteName);
    marker = new google.maps.Marker({
    position: point,
    map: map,
    icon: image
    });

The code for createMarker function is as follows:

       function createMarker(point, address1, town, postcode, sitename) {

        var html;
        var infowindow;
        html = '<b>' + sitename + '</b>' + '<br/>' + address1 + '<br/>' + town + '<br/>' + postcode;
        var marker = new google.maps.Marker({ position: point, map: map });            

        google.maps.event.addListener(marker, "mouseover", function () {
            if (infowindow) infowindow.close();
            infowindow = new google.maps.InfoWindow({ content: html });
            infowindow.open(map, marker);
        });   

        google.maps.event.addListener(marker, "click", function () {
            if (infowindow) infowindow.close();
            infowindow = new google.maps.InfoWindow({ content: html });
            infowindow.open(map, marker);
        });            
        return marker;
    }
  • 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-06-13T23:06:30+00:00Added an answer on June 13, 2026 at 11:06 pm

    Icon property- can be set an image OR vector path:
    Example-

      marker = new google.maps.Marker({
        position: new google.maps.LatLng(-25.363882, 131.044922),
        icon: {
        path: google.maps.SymbolPath.CIRCLE, 
        },
        or
        icon: url of an image,
        draggable: true,
        map: map,
        animation: google.maps.Animation.DROP
    });
    

    This icon property will override the default ballon icon

    Or if you want to set the icon later in the code- just write- marker.setIcon("your url");


    UPDATE: You are actually creating two markers at the same location, one with the custom icon and with default icon.
    Here-

    marker = createMarker(point, address1, town, postcode, SiteName);`// marker1`
        marker = new google.maps.Marker({ `...... //marker 2`
    

    So combine these both-

    function createMarker(point, address1, town, postcode, sitename, image) {
    //code
    
    var marker = new google.maps.Marker({ position: point, map: map, icon:image }); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a 3rd party .dll that I have successfully added as a reference
I have a problem with SharePoint custom web part. It was successfully deployed and
I have successfully added a custom font to my project and it works just
I have a custom wpf control to do an arbitrary reverse image warp, that
I have successfully added my own custom HTML templates for the password reset pages
I have successfully added the original image into my imgs/ folder and also onto
I have successfully added a tinyMCE editor to my web-app so that users can
I am building an Android app using phoneGap and I have successfully added the
I have a png icon, it's added successfully in my project, but not included
I have successfully created a feature in sharepoint that modifies the existing edit dialog

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.