first commit
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
/* ------------------------------------------------------------------------------
|
||||
*
|
||||
* # Bicycle layer
|
||||
*
|
||||
* Specific JS code additions for maps_google_layers.html page
|
||||
*
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
// Setup module
|
||||
// ------------------------------
|
||||
|
||||
var GoogleMapLayerBicycling = function() {
|
||||
|
||||
|
||||
//
|
||||
// Setup module components
|
||||
//
|
||||
|
||||
// Line chart
|
||||
var _googleMapLayerBicycling = function() {
|
||||
if (typeof google == 'undefined') {
|
||||
console.warn('Warning - Google Maps library is not loaded.');
|
||||
return;
|
||||
}
|
||||
|
||||
// Initialize
|
||||
function initialize() {
|
||||
|
||||
// Define map element
|
||||
var map_layer_bicycling_element = document.getElementById('map_layer_bicycling');
|
||||
|
||||
// Set coordinates
|
||||
var myLatlng = new google.maps.LatLng(47.377455, 8.536715);
|
||||
|
||||
// Options
|
||||
var mapOptions = {
|
||||
zoom: 14,
|
||||
center: myLatlng
|
||||
};
|
||||
|
||||
// Apply options
|
||||
var map = new google.maps.Map(map_layer_bicycling_element, mapOptions);
|
||||
|
||||
// Add layers
|
||||
var bikeLayer = new google.maps.BicyclingLayer();
|
||||
bikeLayer.setMap(map);
|
||||
}
|
||||
|
||||
// Load map
|
||||
google.maps.event.addDomListener(window, 'load', initialize);
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// Return objects assigned to module
|
||||
//
|
||||
|
||||
return {
|
||||
init: function() {
|
||||
_googleMapLayerBicycling();
|
||||
}
|
||||
}
|
||||
}();
|
||||
|
||||
|
||||
// Initialize module
|
||||
// ------------------------------
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
GoogleMapLayerBicycling.init();
|
||||
});
|
||||
@@ -0,0 +1,77 @@
|
||||
/* ------------------------------------------------------------------------------
|
||||
*
|
||||
* # Fusion table
|
||||
*
|
||||
* Specific JS code additions for maps_google_layers.html page
|
||||
*
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
// Setup module
|
||||
// ------------------------------
|
||||
|
||||
var GoogleMapFusionTable = function() {
|
||||
|
||||
|
||||
//
|
||||
// Setup module components
|
||||
//
|
||||
|
||||
// Line chart
|
||||
var _googleMapFusionTable = function() {
|
||||
if (typeof google == 'undefined') {
|
||||
console.warn('Warning - Google Maps library is not loaded.');
|
||||
return;
|
||||
}
|
||||
|
||||
// Initialize
|
||||
function initialize() {
|
||||
|
||||
// Define map element
|
||||
var map_fusion_table_element = document.getElementById('map_layer_fusion_tables');
|
||||
|
||||
// Set coordinates
|
||||
var chicago = new google.maps.LatLng(41.850036, -87.6800523);
|
||||
|
||||
// Options
|
||||
var mapOptions = {
|
||||
center: chicago,
|
||||
zoom: 12
|
||||
};
|
||||
|
||||
// Apply options
|
||||
var map = new google.maps.Map(map_fusion_table_element, mapOptions);
|
||||
|
||||
// Add layers
|
||||
var layer = new google.maps.FusionTablesLayer({
|
||||
query: {
|
||||
select: '\'Geocodable address\'',
|
||||
from: '1mZ53Z70NsChnBMm-qEYmSDOvLXgrreLTkQUvvg'
|
||||
}
|
||||
});
|
||||
layer.setMap(map);
|
||||
}
|
||||
|
||||
// Load map
|
||||
google.maps.event.addDomListener(window, 'load', initialize);
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// Return objects assigned to module
|
||||
//
|
||||
|
||||
return {
|
||||
init: function() {
|
||||
_googleMapFusionTable();
|
||||
}
|
||||
}
|
||||
}();
|
||||
|
||||
|
||||
// Initialize module
|
||||
// ------------------------------
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
GoogleMapFusionTable.init();
|
||||
});
|
||||
@@ -0,0 +1,72 @@
|
||||
/* ------------------------------------------------------------------------------
|
||||
*
|
||||
* # Traffic layer
|
||||
*
|
||||
* Specific JS code additions for maps_google_layers.html page
|
||||
*
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
// Setup module
|
||||
// ------------------------------
|
||||
|
||||
var GoogleMapLayerTraffic = function() {
|
||||
|
||||
|
||||
//
|
||||
// Setup module components
|
||||
//
|
||||
|
||||
// Line chart
|
||||
var _googleMapLayerTraffic = function() {
|
||||
if (typeof google == 'undefined') {
|
||||
console.warn('Warning - Google Maps library is not loaded.');
|
||||
return;
|
||||
}
|
||||
|
||||
// Initialize
|
||||
function initialize() {
|
||||
|
||||
// Define map element
|
||||
var map_layer_traffic_element = document.getElementById('map_layer_traffic');
|
||||
|
||||
// Set coordinates
|
||||
var myLatlng = new google.maps.LatLng(40.4122142, -3.7059725);
|
||||
|
||||
// Options
|
||||
var mapOptions = {
|
||||
zoom: 12,
|
||||
center: myLatlng
|
||||
}
|
||||
|
||||
// Apply options
|
||||
var map = new google.maps.Map(map_layer_traffic_element, mapOptions);
|
||||
|
||||
// Add layers
|
||||
var trafficLayer = new google.maps.TrafficLayer();
|
||||
trafficLayer.setMap(map);
|
||||
}
|
||||
|
||||
// Load map
|
||||
google.maps.event.addDomListener(window, 'load', initialize);
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// Return objects assigned to module
|
||||
//
|
||||
|
||||
return {
|
||||
init: function() {
|
||||
_googleMapLayerTraffic();
|
||||
}
|
||||
}
|
||||
}();
|
||||
|
||||
|
||||
// Initialize module
|
||||
// ------------------------------
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
GoogleMapLayerTraffic.init();
|
||||
});
|
||||
@@ -0,0 +1,72 @@
|
||||
/* ------------------------------------------------------------------------------
|
||||
*
|
||||
* # Transit layer
|
||||
*
|
||||
* Specific JS code additions for maps_google_layers.html page
|
||||
*
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
// Setup module
|
||||
// ------------------------------
|
||||
|
||||
var GoogleMapLayerTransit = function() {
|
||||
|
||||
|
||||
//
|
||||
// Setup module components
|
||||
//
|
||||
|
||||
// Line chart
|
||||
var _googleMapLayerTransit = function() {
|
||||
if (typeof google == 'undefined') {
|
||||
console.warn('Warning - Google Maps library is not loaded.');
|
||||
return;
|
||||
}
|
||||
|
||||
// Initialize
|
||||
function initialize() {
|
||||
|
||||
// Define map element
|
||||
var map_layer_transit_element = document.getElementById('map_layer_transit');
|
||||
|
||||
// Set coordinates
|
||||
var myLatlng = new google.maps.LatLng(51.501904,-0.115871);
|
||||
|
||||
// Options
|
||||
var mapOptions = {
|
||||
zoom: 14,
|
||||
center: myLatlng
|
||||
}
|
||||
|
||||
// Apply options
|
||||
var map = new google.maps.Map(map_layer_transit_element, mapOptions);
|
||||
|
||||
// Add layers
|
||||
var transitLayer = new google.maps.TransitLayer();
|
||||
transitLayer.setMap(map);
|
||||
}
|
||||
|
||||
// Load map
|
||||
google.maps.event.addDomListener(window, 'load', initialize);
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// Return objects assigned to module
|
||||
//
|
||||
|
||||
return {
|
||||
init: function() {
|
||||
_googleMapLayerTransit();
|
||||
}
|
||||
}
|
||||
}();
|
||||
|
||||
|
||||
// Initialize module
|
||||
// ------------------------------
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
GoogleMapLayerTransit.init();
|
||||
});
|
||||
Reference in New Issue
Block a user