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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T23:11:33+00:00 2026-06-10T23:11:33+00:00

I’ve successfully added OSM as a new base map type to my Google Maps

  • 0

I’ve successfully added OSM as a new base map type to my Google Maps API aplication.

Next I’ve added a new overlay map type, which adds hill shading to the map.
The documentation on overlay map types on https://developers.google.com/maps/documentation/javascript/maptypes?hl=en#OverlayMapTypes says:

“[…]you can add the map type to an existing MapType[…]”

“Overlay map types will display on top of any base map they are attached to.”

And “The following example is identical to the previous one except that we’ve created a tile overlay MapType on top of the ROADMAP map type:”

But in the code example the overlay map type is always shown on either map type you chose.

  1. How can I make my hillshading overlay map type to be only shown on map type “roadmap” and my custom “OSM” map type? EDIT: To be more precise: Actually I want to know, if there is a way to do this automatically like the docs above suggest. I know, how to do this manually by listening to the maptypeid_changed event.

  2. Is there a way to add my overlay map type to the mapTypeControl as a checkbox like it’s done with “Labels” on the default satellite map type or “terrain” on the roadmap map type?
    EDIT: Until some days ago the official docs above suggested a way to do this, but did not describe it exactly and the linked example was broken (404-link). Thy user here found the same issue: Google maps api: Customising the MapTypeControl for separate map overlays

EDIT:
I’ve posted the jsFiddl of my current solution below.

  • 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-10T23:11:35+00:00Added an answer on June 10, 2026 at 11:11 pm

    Well, looks like there is no native way, to bind an overlay map type to a base map type or to use Googles map type control for overlay map type.

    So here is what I have finally done, to work around this issue: http://jsfiddle.net/lejared/720L7wu0/3/

    var ReliefCtrl = {/* see fiddle */};
    

    I’ve build a custom control (with the look an feel of the native Google maps controls). This Control toggles my overlay map type (Hillshading). You can define a array of base map types suitable for this overlay map type. The control will than show/hide itself automatically if a suitable base map type is selected.

    2017-02-01: Updates fiddle to match new native look of googles map controls.

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

Sidebar

Related Questions

I'm making a simple page using Google Maps API 3. My first. One marker
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I want use html5's new tag to play a wav file (currently only supported
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have an autohotkey script which looks up a word in a bilingual dictionary
I have a text area in my form which accepts all possible characters from

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.