Permalink
Browse files

Merge branch 'master' of github.com:geetarista/jquery.mapfu

  • Loading branch information...
2 parents 4b8595b + f5ad042 commit 0e9ba1423a719dac5456cfed764c05e4d73a72e2 @geetarista committed Jul 2, 2011
Showing with 8 additions and 6 deletions.
  1. +8 −6 jquery.mapfu.js
View
@@ -23,17 +23,19 @@
// Set the root key for the json object since it is unkown
// TODO: See if there is another way to accomplish this
+
var keys = [];
- for (key in opts.data[0]) {
- keys.push(key);
+ for (var key in opts.data[0]) {
+ if (key)
+ keys.push(key);
}
var rootKey = keys[0];
// Initiate array to hold marker html contents
var htmlArray = [];
// Set latitude and longitude if no option is given
- if (opts.latitude == null && opts.longitude == null) {
+ if (opts.latitude === null && opts.longitude === null) {
// Set lat/lng for first object if exists
if (opts.data.length > 0) {
opts.latitude = opts.data[0][rootKey].lat;
@@ -52,7 +54,7 @@
navigationControl: opts.navigationControl,
mapTypeControl: opts.mapTypeControl,
scaleControl: opts.scaleControl
- }
+ };
// Initialize Google Map object
var map = new google.maps.Map(this, mapOptions);
@@ -116,14 +118,14 @@
};
directionsService.route(directionsReq, function(result, status) {
- if (opts.directionsResult != null) {
+ if (opts.directionsResult !== null) {
opts.directionsResult(result, status, directionsDisplay);
} else if (status == google.maps.DirectionsStatus.OK) {
directionsDisplay.setDirections(result);
} else {
try {
console.log("Error: " + status);
- } catch(e) { alert(status) };
+ } catch(e) { alert(status); }
}
});
} else if (opts.data.length > 0) {

0 comments on commit 0e9ba14

Please sign in to comment.