first commit
This commit is contained in:
@@ -0,0 +1,68 @@
|
||||
/* ------------------------------------------------------------------------------
|
||||
*
|
||||
* # Adding controls
|
||||
*
|
||||
* Specific JS code additions for maps_google_controls.html page
|
||||
*
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
// Setup module
|
||||
// ------------------------------
|
||||
|
||||
var GoogleMapControls = function() {
|
||||
|
||||
|
||||
//
|
||||
// Setup module components
|
||||
//
|
||||
|
||||
// Line chart
|
||||
var _googleMapControls = function() {
|
||||
if (typeof google == 'undefined') {
|
||||
console.warn('Warning - Google Maps library is not loaded.');
|
||||
return;
|
||||
}
|
||||
|
||||
// Initialize
|
||||
function initialize() {
|
||||
|
||||
// Define map element
|
||||
var map_controls_element = document.getElementById('map_adding_controls');
|
||||
|
||||
// Options
|
||||
var mapOptions = {
|
||||
zoom: 11,
|
||||
center: new google.maps.LatLng(48.136, 11.574),
|
||||
panControl: false,
|
||||
zoomControl: false,
|
||||
scaleControl: true
|
||||
}
|
||||
|
||||
// Apply options
|
||||
var map = new google.maps.Map(map_controls_element, mapOptions);
|
||||
}
|
||||
|
||||
// Load map
|
||||
google.maps.event.addDomListener(window, 'load', initialize);
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// Return objects assigned to module
|
||||
//
|
||||
|
||||
return {
|
||||
init: function() {
|
||||
_googleMapControls();
|
||||
}
|
||||
}
|
||||
}();
|
||||
|
||||
|
||||
// Initialize module
|
||||
// ------------------------------
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
GoogleMapControls.init();
|
||||
});
|
||||
@@ -0,0 +1,73 @@
|
||||
/* ------------------------------------------------------------------------------
|
||||
*
|
||||
* # Control options
|
||||
*
|
||||
* Specific JS code additions for maps_google_controls.html page
|
||||
*
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
// Setup module
|
||||
// ------------------------------
|
||||
|
||||
var GoogleMapControlOptions = function() {
|
||||
|
||||
|
||||
//
|
||||
// Setup module components
|
||||
//
|
||||
|
||||
// Line chart
|
||||
var _googleMapControlOptions = function() {
|
||||
if (typeof google == 'undefined') {
|
||||
console.warn('Warning - Google Maps library is not loaded.');
|
||||
return;
|
||||
}
|
||||
|
||||
// Initialize
|
||||
function initialize() {
|
||||
|
||||
// Define map element
|
||||
var map_control_options_element = document.getElementById('map_control_options');
|
||||
|
||||
// Options
|
||||
var mapOptions = {
|
||||
zoom: 6,
|
||||
center: new google.maps.LatLng(51.164, 10.454),
|
||||
mapTypeControl: true,
|
||||
mapTypeControlOptions: {
|
||||
style: google.maps.MapTypeControlStyle.DROPDOWN_MENU
|
||||
},
|
||||
zoomControl: true,
|
||||
zoomControlOptions: {
|
||||
style: google.maps.ZoomControlStyle.SMALL
|
||||
}
|
||||
}
|
||||
|
||||
// Apply options
|
||||
var map = new google.maps.Map(map_control_options_element, mapOptions);
|
||||
}
|
||||
|
||||
// Load map
|
||||
google.maps.event.addDomListener(window, 'load', initialize);
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// Return objects assigned to module
|
||||
//
|
||||
|
||||
return {
|
||||
init: function() {
|
||||
_googleMapControlOptions();
|
||||
}
|
||||
}
|
||||
}();
|
||||
|
||||
|
||||
// Initialize module
|
||||
// ------------------------------
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
GoogleMapControlOptions.init();
|
||||
});
|
||||
@@ -0,0 +1,84 @@
|
||||
/* ------------------------------------------------------------------------------
|
||||
*
|
||||
* # Control positioning
|
||||
*
|
||||
* Specific JS code additions for maps_google_controls.html page
|
||||
*
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
// Setup module
|
||||
// ------------------------------
|
||||
|
||||
var GoogleMapControlPosition = function() {
|
||||
|
||||
|
||||
//
|
||||
// Setup module components
|
||||
//
|
||||
|
||||
// Line chart
|
||||
var _googleMapControlPosition = function() {
|
||||
if (typeof google == 'undefined') {
|
||||
console.warn('Warning - Google Maps library is not loaded.');
|
||||
return;
|
||||
}
|
||||
|
||||
// Initialize
|
||||
function initialize() {
|
||||
|
||||
// Define map element
|
||||
var map_control_position_element = document.getElementById('map_control_positioning');
|
||||
|
||||
// Optinos
|
||||
var mapOptions = {
|
||||
zoom: 12,
|
||||
center: new google.maps.LatLng(-28.643387, 153.612224),
|
||||
mapTypeControl: true,
|
||||
mapTypeControlOptions: {
|
||||
style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR,
|
||||
position: google.maps.ControlPosition.BOTTOM_CENTER
|
||||
},
|
||||
panControl: true,
|
||||
panControlOptions: {
|
||||
position: google.maps.ControlPosition.TOP_RIGHT
|
||||
},
|
||||
zoomControl: true,
|
||||
zoomControlOptions: {
|
||||
style: google.maps.ZoomControlStyle.LARGE,
|
||||
position: google.maps.ControlPosition.LEFT_CENTER
|
||||
},
|
||||
scaleControl: true,
|
||||
streetViewControl: true,
|
||||
streetViewControlOptions: {
|
||||
position: google.maps.ControlPosition.LEFT_TOP
|
||||
}
|
||||
}
|
||||
|
||||
// Apply options
|
||||
var map = new google.maps.Map(map_control_position_element, mapOptions);
|
||||
}
|
||||
|
||||
// Load map
|
||||
google.maps.event.addDomListener(window, 'load', initialize);
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// Return objects assigned to module
|
||||
//
|
||||
|
||||
return {
|
||||
init: function() {
|
||||
_googleMapControlPosition();
|
||||
}
|
||||
}
|
||||
}();
|
||||
|
||||
|
||||
// Initialize module
|
||||
// ------------------------------
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
GoogleMapControlPosition.init();
|
||||
});
|
||||
@@ -0,0 +1,66 @@
|
||||
/* ------------------------------------------------------------------------------
|
||||
*
|
||||
* # Disable default UI
|
||||
*
|
||||
* Specific JS code additions for maps_google_controls.html page
|
||||
*
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
// Setup module
|
||||
// ------------------------------
|
||||
|
||||
var GoogleMapDisableUi = function() {
|
||||
|
||||
|
||||
//
|
||||
// Setup module components
|
||||
//
|
||||
|
||||
// Line chart
|
||||
var _googleMapDisableUi = function() {
|
||||
if (typeof google == 'undefined') {
|
||||
console.warn('Warning - Google Maps library is not loaded.');
|
||||
return;
|
||||
}
|
||||
|
||||
// Initialize
|
||||
function initialize() {
|
||||
|
||||
// Define map element
|
||||
var map_disable_ui_element = document.getElementById('map_ui_disabled');
|
||||
|
||||
// Options
|
||||
var mapOptions = {
|
||||
zoom: 12,
|
||||
center: new google.maps.LatLng(48.858, 2.347),
|
||||
disableDefaultUI: true
|
||||
}
|
||||
|
||||
// Apply options
|
||||
var map = new google.maps.Map(map_disable_ui_element, mapOptions);
|
||||
}
|
||||
|
||||
// Load map
|
||||
google.maps.event.addDomListener(window, 'load', initialize);
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// Return objects assigned to module
|
||||
//
|
||||
|
||||
return {
|
||||
init: function() {
|
||||
_googleMapDisableUi();
|
||||
}
|
||||
}
|
||||
}();
|
||||
|
||||
|
||||
// Initialize module
|
||||
// ------------------------------
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
GoogleMapDisableUi.init();
|
||||
});
|
||||
Reference in New Issue
Block a user