ThinkGeo.com    |     Documentation    |     Premium Support

Google overlay bug

Hi

In my application, I am giving 2 basemap options. 1.Normal map, 2. Google map
User can switch from one base map to another.

  1. Normal map measnCountries.shp shape file. and its working fine.
  2. But when i am switching to google some times i am getting map and some times i am getting javascript error.

I have created new Google API key and using it for Google overlay. The bug is follows

I am using following code to display Google map

                    GoogleOverlay google = new GoogleOverlay("Google Map");
                    google.JavaScriptLibraryUri = new Uri("https://maps.google.com/maps/api/js?key=AIzaSyCcjq_hjHHrD6zlVxZ4ZATD5LVkWkN4gGw");
                    switch (googleOptions)
                    {
                        case "1": google.GoogleMapType = GoogleMapType.Normal; btnRoad.Checked = true; break;
                        case "2": google.GoogleMapType = GoogleMapType.Hybrid; btnAerial.Checked = true; break;
                        case "3": google.GoogleMapType = GoogleMapType.Satellite; btnSatellite.Checked = true; break;
                        case "4": google.GoogleMapType = GoogleMapType.Physical; btnPhysical.Checked = true; break;
                        default: google.GoogleMapType = GoogleMapType.Satellite; btnSatellite.Checked = true; break;

                    }
                    google.IsBaseOverlay = true;
                    wfMap.CustomOverlays.Add(google);

Please suggest me how to resolve this issue.
Thank you,
Ashok

Hi Ashok,

The error is “The serialized data is invalid”, I hadn’t found it’s related with Google map from the error information and also hadn’t found it’s related with OpenLayers(The client library of web edition).

So I search on internet about this problem, and found it’s an asp.net error, which should be related with ViewState or Session.

So please check the custom JS code in your project, or you can try to build a single page with Google map and see whether it can be reproduced.

Regards,

Ethan