Monday, July 5, 2010

Message: Not Implemented (Annoying Javascript Error)

Hello Everyone,

Recently i was doing some development stuff on Google maps API. After i finished my integration of google maps and google street view API with my application, during testing, i found an annoying Message: Not Implemented error message and the line number to which it was pointing was 1 and was senseless. I did'nt get this error on other browsers like Chrome & Firefox. This error was specific to internet explorer only (Why the hell they keep javascript's different for different browser's god knows !!!). Well, so i did some research and ultimately found a solution.

The error was in one of my javascript's onload function.

In my buggy code it was something like below ::

body.onload=loadMap();

I removed those open close parenthesis and my error got vanished.

body.onload=loadMap;

Internet explorer was really pointing to a strange line number to which you can never imagine this sort of error.

Anyways, thank god to internet explorer 8 javascript debugger which really helped me in finding the correct issue.

Cheers,

Ujjwal Soni

Thursday, July 1, 2010

Google Street View availability validation

Hi,

Yesterday, i was working on street view google maps api, i faced an issue on validating some addresses as well as some latitude longitude data for street view. As street view is avaiable only for some locations, some addresses were showing as blank on street view. I managed to validate that via code mentioned below.

function showStreetViewGoogleMaps()
{



 var svClient = new GStreetviewClient();

        svClient.getNearestPanoramaLatLng(point, function (nearest) {
          if ((nearest !== null) && (point.distanceFrom(nearest) <= 100)) {
             alert('Street view available');
          }
          else {
             alert('Street view not available');        // Not within 100 meters
          }
       });


}

This is how i managed to validate street view for google maps.

Cheers!!!

Ujjwal Soni