• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

I Like Kill Nerds

The blog of Australian Front End / Aurelia Javascript Developer & brewing aficionado Dwayne Charrington // Aurelia.io Core Team member.

  • Home
  • Aurelia 2
  • Aurelia 1
  • About
  • Aurelia 2 Consulting/Freelance Work

Fixing The Google Maps Broken Zoom Control and Streetview Icon Issue

General · February 12, 2013

Chances are if you’re developing a responsive website and using a Google map you will encounter an issue where the zoom control and street view control appear to be broken, they’re there but not clickable and look corrupted. The issue is the usual process of developing a responsive site entails of setting max-width: 100% to all images on the site in the form of the following:

img {
    max-width: 100%;
}

This will also break your Google Map controls. The simple fix is to fix the max-width property by targeting your map container with the following CSS:

#mapcontainer img { max-width: inherit; }

Replace #mapcontainer with the ID of your map and presto, problem solved. If that doesn’t solve the issue, you can try appending an !important declaration to the end of it to override any potentially persistent CSS (but you should never need to do that).

Dwayne

Leave a Reply Cancel reply

3 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
andrea
andrea
8 years ago

Thanks 🙂

0
ralph
ralph
7 years ago

It works.. I saw this other solution on stockovrflow

.gm-style img { max-width: none; }
.gm-style label { width: auto; display: inline; }

0
Cheryl
Cheryl
5 years ago

Mine was actually a max-height issue, but I never would have considered it without this article. Thanks so much for taking the time to write this out for everyone.

0

Primary Sidebar

Popular

  • Testing Event Listeners In Jest (Without Using A Library)
  • How To Get The Hash of A File In Node.js
  • Thoughts on the Flipper Zero
  • Waiting for an Element to Exist With JavaScript
  • How To Paginate An Array In Javascript
  • Handling Errors with the Fetch API
  • ChatGPT Stopping Part Way Through a Response? Here Is How You Fix It
  • How To Get Last 4 Digits of A Credit Card Number in Javascript
  • How to Use Neural DSP Archetype Plugins With the Quad Cortex
  • How To Mock uuid In Jest

Recent Comments

  • CJ on Microsoft Modern Wireless Headset Review
  • Dwayne on Microsoft Modern Wireless Headset Review
  • CJ on Microsoft Modern Wireless Headset Review
  • john on Microsoft Modern Wireless Headset Review
  • Dwayne on Why You Should Be Using globalThis Instead of Window In Your Javascript Code

Copyright © 2023 · Dwayne Charrington · Log in

wpDiscuz