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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T09:45:20+00:00 2026-06-10T09:45:20+00:00

For a Christmas Market, I’m currently working on a Google Maps map. I load

  • 0

For a Christmas Market, I’m currently working on a Google Maps map. I load a sprite of different icons representing the market boothes in their different sizes:

enter image description here

(the greyed out version is for deactivated status):
http://www.felixkittler.de/area51/googlemaps/buden.html

Everything works fine so far, as long as the user does not zoom in or out – if so, the boothes are not scaled and consequently seem far too big or small.

I thought I might predefine another set of icons, containing the same markers, but with scaled markerImages. Unfortunately, I can’t get this to work:

for(i=0; i<markerSizes.length; i++){
    var aktiv = new google.maps.MarkerImage(
        "http://www.felixkittler.de/area51/googlemaps/buden/SPRITE.png", 
        new google.maps.Size(markerSizes[i], 27, "px", "px"),
        new google.maps.Point(85, i*30),
        new google.maps.Point(0, 0),
        new google.maps.Size(markerSizes[i]*2, 14) //this doesn't work!!!
    );
    gicons_aktiv.push(aktiv);
}

I do not yet track the zoom_changed event, but I set up a version of my file which should use the scaled icons:
http://www.felixkittler.de/area51/googlemaps/buden_scaled.html
(scaling up (x2) in lines 116 & 125).

Any ideas how to solve this problem?
Since this is not the only sprite I’m using, I would like to avoid uploading multiple resolutions of the same sprite, scaling up or down would be much more convenient.

Thanks!!!

  • 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-10T09:45:21+00:00Added an answer on June 10, 2026 at 9:45 am

    So, I just found out by myself.
    Thanks to Marc Ridey for this blog post!

    Marker Image for original size:

    var original = new google.maps.MarkerImage(
        "http://www.path/to/sprite.png", 
        new google.maps.Size(markerSizes[i], 24), //marker height=24, width in array
        new google.maps.Point(0, i*30), // each row of the sprite grid is 30px tall
        new google.maps.Point(0, 0),
        null // use file dimensions 168 x 270px
    );
    

    Marker Image for displaying marker scaled 50% down:

    var half = new google.maps.MarkerImage(
        "http://www.path/to/sprite.png", 
        new google.maps.Size(markerSizes[i]/2, 12),
        new google.maps.Point(0, i*15),
        new google.maps.Point(0, 0),
        new google.maps.Size(84, 135) // original dimension of sprite: 168 x 270 px
    );
    

    Hope this helps anyone (:

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

Sidebar

Related Questions

with the holiday (anouka and Christmas) i wanted to show different version of my
I'm currently working on a script that will allow users to drag decoration images
I am creating Christmas countdown and I need to count down every second and
For a Christmas gift, I'd like to make a brief Zelda-style (circa Link's Awakening)
I need to calculate the time till Christmas in milliseconds. I'm using joda time
I am trying to implement Joda-Time to count down to Christmas, but so far
I have an advent/christmas calendar. Everyday is another picture with one more door opened.
Over this past Christmas holiday week, when the website I work on was experiencing
How to calculate shopping days till christmas counter in jQuery. need to add to
I received a Mindstorms NXT set for Christmas. The first thing I did was

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.