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 4028786
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T11:15:49+00:00 2026-05-20T11:15:49+00:00

I have this cide to duplicate an icon from a previously declared marker, but

  • 0

I have this cide to duplicate an icon from a previously declared marker, but it does not work:

map = new google.maps.Map(document.getElementById('map'), {
  zoom:12,
  center:latlng2,
  mapTypeId:google.maps.MapTypeId.SATELLITE
});

marker = new google.maps.Marker({
  map:map,
  icon: new google.maps.MarkerImage(
    'http://www.gettyicons.com/free-icons/108/gis-gps/png/24/needle_left_yellow_2_24.png',
    new google.maps.Size(24, 24),
    new google.maps.Point(0, 0),
    new google.maps.Point(0, 24)
  )
});

var babyIcon = new google.maps.MarkerImage(marker.getIcon(),
  new google.maps.Size(
      marker.getIcon().size.width * this.iconScale_,
      marker.getIcon().size.height * this.iconScale_
  ),
  new google.maps.Point(0,0),
  new google.maps.Point (
      marker.getIcon().anchor.x * this.iconScale_,
      marker.getIcon().anchor.y * this.iconScale_ / 2
  )
);

// kill the shadow
babyIcon.shadow = null;

this.babyMarker_ = new google.maps.Marker({
  position:new google.maps.LatLng(0,0),
  icon: babyIcon,
  draggable:false,
  map:map
});

it does not work, the icon does not display and all that. Is there something I am missing?

  • 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-20T11:15:50+00:00Added an answer on May 20, 2026 at 11:15 am

    You need to set the url of the MarkerImage, the property you need is .ra (don’t ask me)

    var babyIcon = new google.maps.MarkerImage(
      marker.getIcon().ra,
      new google.maps.Size(
          marker.getIcon().size.width * this.iconScale_,
          marker.getIcon().size.height * this.iconScale_
      ),
      new google.maps.Point(0,0),
      new google.maps.Point (
          marker.getIcon().anchor.x * this.iconScale_,
          marker.getIcon().anchor.y * this.iconScale_ / 2
      )
    );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code but it doesn't work! public class Trial { public static
I have this query, which I know doesn't work, but I've left it as
I have this query on my CMS but it doesn't work. I try to
I have this line but not sure about the + string part. It is
Have this self-made slider: http://jsfiddle.net/wyc3P/4/ What it does: takes min and max values in
Have this dictionay retrieving values from DataTable: Dictionary<string,string> meta= ds.Tables[1].Select(key<>'format').AsEnumerable().ToDictionary(k=>k.Field<string>(0),v=>v.Field<string>(1)); How would I apply
Have have this line of code in my form when I create a new
I have this query: SELECT DISTINCT phone, department FROM `users` WHERE ((SUBSTRING(phone,1,3) = '399')
I have this code that I have written in Ruby, but when trying to
I have this code : IList<MyObject> myObjects = new List<MyObject>(); if (param != null)

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.