Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions src/maplace.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@
this.oMap = false;
this.view_all_key = 'all';

this.bicycling_layer = new google.maps.BicyclingLayer();
this.bicycling_layer_shown = false;
this.infowindow = null;
this.ln = 0;
this.oMap = false;
Expand Down Expand Up @@ -177,6 +179,7 @@
start: 0,
locations: [],
commons: {},
bicycling_layer: false,
map_options: {
mapTypeId: google.maps.MapTypeId.ROADMAP,
zoom: 1
Expand Down Expand Up @@ -264,6 +267,10 @@
}).appendTo(this.map_div);

this.oMap = new google.maps.Map(this.canvas_map.get(0), this.o.map_options);

if (this.o.bicycling_layer) {
this.ShowBicyclingLayer();
}
} catch (err) {
this.errors.push(err.toString());
}
Expand Down Expand Up @@ -717,6 +724,18 @@
this.debug('03');
};

//overlay the bicycling layer on the map
Maplace.prototype.ShowBicyclingLayer = function () {
this.bicycling_layer.setMap(this.oMap);
this.bicycling_layer_shown = true;
};

//remove the bicycling layer from the map
Maplace.prototype.HideBicyclingLayer = function () {
this.bicycling_layer.setMap(null)
this.bicycling_layer_shown = false;
};

//replace current locations
Maplace.prototype.SetLocations = function (locs, reload) {
this.o.locations = locs;
Expand Down Expand Up @@ -776,6 +795,11 @@
return this.loaded;
};

//check if bicycling layer has been overlayed on map
Maplace.prototype.BicyclingLayerShown = function () {
return this.bicycling_layer_shown;
};

//loads the options
Maplace.prototype._init = function () {
//store the locations length
Expand Down