13

Culdn`t find what makes that error, and how to find a solution...

Working under project:

http://atlas.sitegist.net/business/atlas/?l=en&h=6dff16b6f593384662cb24d66142047a

In project i show different data with integer values, and all that also shown on a map. When i added another visualisation of new data set, error occurs.

Testing information:

Mostly i must do some events in UI, and of course doing some mixing of listed under:

  • must click "Projects" button, and then check/uncheck checkboxes in toolbar section of my project
  • must click events on left sidebar panel (No need to expand collapse, for given data set selection of objects is made by choosing on of the parents)

Sometimes error ocuurs in 5 min. Sometimes in first shot, but ostly in 3-4 UI request.

the link above reproduce an error from start, or by 2-3 event triggers.

Errors: Copy paste from console

And such error i have in Chrome console:

Uncaught RangeError: Maximum call stack size exceeded
H.get
(anonymous function)
Mu.(anonymous function).zoomRange_changed
yf
H.set
(anonymous function)
Mu.(anonymous function).zoomRange_changed
yf
H.set
(anonymous function)
Mu.(anonymous function).zoomRange_changed
yf
...
H.set
(anonymous function)
Mu.(anonymous function).zoomRange_changed
yf

And onother one:

<error>
(anonymous function)
$
nm
Du
H.bf
H.mapType_changed
yf
H.set
H.aa
Tg.(anonymous function).J
(anonymous function)
Q.trigger
H.aa
Tg.(anonymous function).J
(anonymous function)
Q.trigger
H.aa
Tg.(anonymous function).J
(anonymous function)
Q.trigger
H.aa
...
H.aa
Tg.(anonymous function).J
(anonymous function)
Q.trigger

Solution under solution didn nott helped me, couse of lack of information about I.set and also I don`t use "Gmaps4rails":

Gmaps4rails Maximum call stack size exceeded?

Community
  • 1
  • 1
Roman M. Koss
  • 970
  • 1
  • 15
  • 33
  • 1
    You should probably add your solution as an answer for this question, then mark your answer as the official answer. If you need any help, just post back a comment here :) – balupton Sep 15 '12 at 01:25

4 Answers4

8

Solved!!!

I found a problem in my bounds variable.

When i receiving JSON from server, while parsing it, the code makes bound from each location on a map.

// renew map bounds each time when new query comes
bounds = new google.maps.LatLngBounds ();
...
for (var key in data.locations ) {
    ...
    // For fitting in Bounds, we push the positions of each location
    atlas.Map.vars.bounds.extend ( new google.maps.LatLng(
        data.locations [key].lat,
        data.locations [key].lng
    ) );    
    ...
}
...
GoogleMap.fitBounds (bounds);

And somehow for the new data type it`s making browser stack to overflow.

(what is very strange, cause it works normal for a even a lot bigier results! (600< elements on a map)).

Made a brute code for fast result:

bounds = new google.maps.LatLngBounds ();
if( KMLLayer.poly.docs[0].bounds != undefined ) {
    bounds.extend( KMLLayer.poly.docs[0].bounds.getNorthEast() );
    bounds.extend( KMLLayer.poly.docs[0].bounds.getSouthWest() );
}
if( KMLLayer.marks.docs[0].bounds != undefined ) {
    bounds.extend( KMLLayer.marks.docs[0].bounds.getNorthEast() );
    bounds.extend( KMLLayer.marks.docs[0].bounds.getSouthWest() );
}
GoogleMap.fitBounds (bounds);

I have two KML layers, so i retrieved bounds, if there occurs some, from GeoXML3 layers.

Damn, i spend for it 6 hours and 38 minutes!!!

Maybe i was wrong with this line, what clears global variable badly:

bounds = new google.maps.LatLngBounds ();

original name of variables are litle longer :) bounds === atlas.Map.vars.bounds;

Community
  • 1
  • 1
Roman M. Koss
  • 970
  • 1
  • 15
  • 33
7

I received the same error. However in my case the issue had to do with the lat and long data. It was one dot short which resulted in this issue.

Related: https://groups.google.com/forum/?fromgroups=#!topic/google-maps-js-api-v3/1SCjxGntruU

Bas G
  • 178
  • 2
  • 11
  • In my case the dots and commas somehow got mixed up. – Jeroen Nov 16 '12 at 19:07
  • This was my problem too. When the site culture was in english, the latlong was correctly set, but when in french, for example, the latlong were written with a comma. I had to make sure that the latlong were always using the invariant culture. – Pierre-Alain Vigeant Jan 25 '13 at 16:22
  • Jish, my was like the same. The more i wor the more i see so many error like that. Or smth with coma or dot. Or some methods are working stange for some browsers... This probem can ony be solved by patience + atention^2 + expirience. Im glad that stackoverflow, google groups and other resoruces helping to speak people with each other. – Roman M. Koss Apr 19 '13 at 07:47
4

This error normally occurs (in Google Chrome) when you forgot to set all minimum options for your map. Those are the following:

var map = new google.maps.Map(
    document.getElementById( 'some-id' ),
    {
        center :    new google.maps.LatLng( 43, 16 ),
        zoom :      10,
        mapTypeId : google.maps.MapTypeId.ROADMAP
    }
);
kaiser
  • 21,817
  • 17
  • 90
  • 110
0

Does your polygon path contain any empty LatLng?

I received the same error when this occured - Stupid mistake but might help someone in a similar situation.

David Lamm
  • 519
  • 1
  • 3
  • 12
  • Emply Lat & Lng fields can only be when prject logic is not whell written or not fully writen. Im avoiding such error by controlling the data on each step. Also working with full data controll helps me more undersand what is required to do to achive whanted results. IMHO. – Roman M. Koss Apr 19 '13 at 07:42