Ibadur Rahman K
Ibadur Rahman K

Reputation: 185

Exception while loading google maps with markers in GWT production mode

I am using Google maps for my application using GWT technologies, the thing is am getting markers in map without any exception or warning in Development mode. But when when I run it in production mode am getting uncaught (TypeError):exception: cannot call method 'Id' of null and when I click Ok button map loads without marker. Can any one help how to solve(track) this exception.

final LatLng mLatLng = LatLng.create(24.675, 46.708);
myOptions = MapOptions.create();
myOptions.setZoom(9);
myOptions.setCenter(mLatLng);
myOptions.setMapTypeId(MapTypeId.ROADMAP);
myOptions.setMapTypeControl(true);
Timer load = new Timer() {

    @Override
    public void run() {
        fullTrackingMap = GoogleMap.create(mapVp.getElement(),myOptions);
            /* Service call here */
            filterMap(hashMap);   // hashmap<String, Marker>
    }
};
load.schedule(1000);


private void filterMap(SortedMap<String, Marker> hashMap) {
            if (hashMap.get(e.getKey()) != null) {
                Marker marker = hashMap.get(e.getKey());
                if (e.getValue().equalsIgnoreCase("false")) {
                    marker.setMap((GoogleMap) null);
                } else {
                    marker.setMap(fullTrackingMap);
                }
                markers.add(marker);
            }
        }

I am getting values for hashmap from server-side not in code snippet above.

Upvotes: 1

Views: 124

Answers (1)

Athif
Athif

Reputation: 66

Check the initialization of objects. the issues in production mode is mainly because of object initialization.

Upvotes: 1

Related Questions