cybersthang / gmaps-utility-library-dev

Automatically exported from code.google.com/p/gmaps-utility-library-dev
0 stars 0 forks source link

Error when creating extInfoWindow without any options #183

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
open an info window without providing a options object
  GEvent.addListener(marker_,'click',function(){
    marker_.openExtInfoWindow(
      map,
      'custom_info_window_red',
      "<h3>"+marker_.place_data.name+"</h3>"+document_links
    );
  });

What is the expected output? What do you see instead?
extInfoWindow should open, instead an error occurs:
this.options_ is undefined (extinfowindow.js Line 50)

Please provide any additional information below.
Calling the function openExtInfoWindow() with an empty object "{}" or null
as the options parameter causes the window to open correctly.
When storing the passed object internally as options_, the comparison does
a value and type comparison (===) with null to check if it should create an
empty object.  I'm assuming that if it is undefined, this passes the
comparison and the internal variable is set to undefined as well.  This
would mean that an extra check for undefined may be required. I'm not sure
if changing the triple equals to only a double equals would work as well,
without breaking anything else.

Original issue reported on code.google.com by geo.appl...@gmail.com on 13 Jan 2010 at 7:03

GoogleCodeExporter commented 8 years ago
I can't change code here yet... But, in constructor, try changing:

this.options_ = opt_opts === null ? {} : opt_opts;

to

this.options_ = (typeof opt_opts == 'undefined' || opt_opts === null) ? {} : 
opt_opts;

Original comment by jgarfi...@earthlink.net on 19 Jan 2010 at 7:41

GoogleCodeExporter commented 8 years ago

Original comment by jgarfi...@earthlink.net on 3 Feb 2010 at 2:00

GoogleCodeExporter commented 8 years ago

Original comment by douglass...@earthlink.net on 18 May 2010 at 10:18