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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T11:33:00+00:00 2026-06-14T11:33:00+00:00

I have tried standard way: class MyMap extends google.maps.Map constructor: (mapDiv, opts)-> super(mapDiv, opts)

  • 0

I have tried standard way:

class MyMap extends google.maps.Map
  constructor: (mapDiv, opts)->
    super(mapDiv, opts)

But in this case placeholder was empty.

  • 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-14T11:33:02+00:00Added an answer on June 14, 2026 at 11:33 am

    This problem is a combo of the way CoffeeScript makes classes and the way that the Google Maps Javascript API is written/obfuscated/minified.

    When CoffeeScript extends a class, it creates code something similar to this:

    customnamespace.CustomMap = (function(_super) {
    
        // '__extends' is a method that gets output at the 
        // top of every CoffeeScript compiled file
        __extends(CustomMap, _super);
    
        function CustomMap(mapDiv, opts) {
            CustomMap.__super__.constructor.apply(this, arguments);
        }
    
        return CustomMap;
    
    })(google.maps.Map);
    

    In most cases, and especially in cases where the “extendee” was written in CoffeeScript, this works great.

    But in the case of google.map.Maps there is (I suspect) a whole bunch of scope manipulation going on and it’s kindof undoing the scope CoffeeScript tries to set. Admittedly this is a guess.

    So in this case it’s time to put on ye olde JavaScript hat and just do some plain old scope-locking on the constructor. So drop your super and apply the function in the scope of the class with a line of JavaScript. CoffeeScript will just wave, smile, and output the JavaScript line as is.

    class MyMap extends google.maps.Map
        constructor: (mapDiv, opts)->
            google.maps.Map.apply(this, [mapDiv, opts]);
    

    Make sense?

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

Sidebar

Related Questions

I have a class based on google.maps.OverlayView which implements a custom replacement for a
I have tried    to display two spaces in a standard output Java String.
this is just some pretty standard code I have tried. What I am trying
I have tried searching over the internet about this problem but not able to
I have tried many permutations but they all don't seems to work well. Am
Have tried to find solutions for this and can't really come up with anything.
I have tried to go through the jungle (really, PayPal, why don't you weed
I have tried this: #define format(f, ...) \ int size = strlen(f) + (sizeof((int[]){__VA_ARGS__})/sizeof(int))
I have tried a variety of different solutions found on stack and other places
I have tried everything in the book and EVERYTHING I could find on how

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.