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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T00:36:46+00:00 2026-05-15T00:36:46+00:00

I am trying to use marker.setIcon() to change a markers image. However it appears

  • 0

I am trying to use marker.setIcon() to change a markers image. However it appears that although this changes the marker.iconUrl attribute the icon itself is using marker.proprietary_marker.$.icon.image to display the markers image – so the markers icon remains unchanged. Is there a way to dynamically change the marker.proprietary_marker.$.icon.image?

  1. Add a marker.
  2. Check the icon’s image url and the proprietary icon’s image – they’re the same.
  3. Change the icon.
  4. Again check the Urls. Now the Icon Url has changed but the marker still shows the old image which is in the proprietary marker object.
 <head>
<title>Map Test</title>
<script src="http://maps.google.com/maps?file=api&v=2&key=Your-Google-API-Key" type="text/javascript"></script>
<script src="mapstraction.js"></script>

<script type="text/javascript">
var map;
var marker;

function getMap(){
        map = new mxn.Mapstraction('myMap','google');
    map.setCenterAndZoom(new mxn.LatLonPoint(45.559242,-122.636467), 15);
}


function addMarker(){
        marker = new mxn.Marker(new mxn.LatLonPoint(45.559242, -122.636467));
    marker.addData({infoBubble : "Text", label : "Label",  marker : 4, icon: "http://mapscripting.com/examples/mashups/richter-high.png"});
    map.addMarker(marker);
}

function changeIcon(){
    marker.setIcon("http://assets1.mapufacture.com/images/markers/usgs_marker.png");
}


function showIconURL(){
        alert(marker.iconUrl);
} 


function showProprietaryIconURL(){
    alert(marker.proprietary_marker.$.icon.image);
}

</script>
</head>
<body onload="getMap()">
<div id="myMap" style="width:627px; height:412px;"></div>
<div>
    <input type="button" value="add marker" OnClick="addMarker();">
    <input type="button" value="change icon" OnClick="changeIcon();">
    <input type="button" value="show icon URL" OnClick="showIconURL();">
    <input type="button" value="show proprierty icon URL " OnClick="showProprietaryIconURL();">
</div>
</body>
</html>
  • 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-15T00:36:47+00:00Added an answer on May 15, 2026 at 12:36 am

    It was to my understanding from what I have read that once you create a marker you can no longer change the “icon” of the marker. You can change the image property of the marker itself but from what I have read I don’t believe that it is possible to change it through the icon options once the marker has been generated.

    I also believe I read that if you do change the image of the icon it will maintain the same size properties that you originally set in your icon settings for the marker options. IE if the first image was set to a 15×15 and the second is a 5×5 the 5×5 will be resized to the 15×15.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am need paint my image. I'm trying use JQuery in here this link:
Trying to use OpenLayers to (eventually) load markers, vectors & WMS on top of
I'm trying to make a Google map that updates a marker as a user's
I am trying to use bash indirection in Solaris 11 express to change the
I'd like to use jQuery with Google maps. I'm trying to replicate this example
I'm trying to place multiple markers on a map that are provided from an
I am using gchart and I am trying to use markers to label my
I'm trying to load a Google Maps v3 that shows 5000 markers clickable. My
I'm trying to use the Google Maps V3 API to create markers on a
i'm trying to use IvoryGoogleMap to display a simple map with markers and infoWindows

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.