API KEY DE GOOGLE MAPS CENTRALIZADA
This commit is contained in:
@@ -3,47 +3,47 @@
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<style type="text/css">
|
||||
html, body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#map {
|
||||
width: 100%;
|
||||
height: calc(100% - 51px);
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#map {
|
||||
position: fixed !important;
|
||||
}
|
||||
|
||||
|
||||
.pac-container.pac-logo {
|
||||
z-index: 100000;
|
||||
}
|
||||
|
||||
#showdiv1 {
|
||||
left: 0 !important;
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
#ShowDiv3:hover {
|
||||
line-height: 34px !important;
|
||||
-webkit-transition: line-height ease 1s;
|
||||
-moz-transition: line-height ease 1s;
|
||||
-o-transition: line-height ease 1s;
|
||||
transition: line-height ease 1s;
|
||||
}
|
||||
|
||||
.v-center {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
<style type="text/css">
|
||||
html, body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#map {
|
||||
width: 100%;
|
||||
height: calc(100% - 51px);
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#map {
|
||||
position: fixed !important;
|
||||
}
|
||||
|
||||
|
||||
.pac-container.pac-logo {
|
||||
z-index: 100000;
|
||||
}
|
||||
|
||||
#showdiv1 {
|
||||
left: 0 !important;
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
#ShowDiv3:hover {
|
||||
line-height: 34px !important;
|
||||
-webkit-transition: line-height ease 1s;
|
||||
-moz-transition: line-height ease 1s;
|
||||
-o-transition: line-height ease 1s;
|
||||
transition: line-height ease 1s;
|
||||
}
|
||||
|
||||
.v-center {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ContentPlaceHolderID="H" ID="Content9" runat="server">
|
||||
@@ -332,10 +332,10 @@
|
||||
<script src="../Metronic/assets/layouts/layout3/scripts/jquery.datetimepicker.full.js"></script>
|
||||
<script>
|
||||
var map;
|
||||
function initMap() {
|
||||
map = new google.maps.Map(document.getElementById('map'), {
|
||||
function initMap() {
|
||||
map = new google.maps.Map(document.getElementById('map'), {
|
||||
center: { lat: 29.0730, lng: -110.9559 },
|
||||
zoom: 7
|
||||
zoom: 7
|
||||
});
|
||||
|
||||
var ShowDiv1 = document.createElement('div');
|
||||
@@ -344,11 +344,11 @@
|
||||
ShowDiv1.id = "showdiv1"
|
||||
map.controls[google.maps.ControlPosition.BOTTOM_CENTER].push(ShowDiv1);
|
||||
|
||||
google.maps.Polygon.prototype.my_getBounds = function () {
|
||||
google.maps.Polygon.prototype.my_getBounds = function () {
|
||||
var bounds = new google.maps.LatLngBounds()
|
||||
this.getPath().forEach(function (element, index) { bounds.extend(element) })
|
||||
return bounds
|
||||
}
|
||||
return bounds
|
||||
}
|
||||
|
||||
}
|
||||
var polylines = [];
|
||||
@@ -357,172 +357,172 @@
|
||||
var markers = [];
|
||||
var lastOpenedInfoWindow;
|
||||
|
||||
$(document).ready(function () {
|
||||
$(document).ready(function () {
|
||||
initMap();
|
||||
$("#SideNav").removeClass("nav-is-visible");
|
||||
$("#dvConsulta").modal({ backdrop: 'static', keyboard: false });
|
||||
$("#dvConsulta").modal({ backdrop: 'static', keyboard: false });
|
||||
});
|
||||
|
||||
function creaPoligono(coords, color, Geocerca) {
|
||||
var polygon = new google.maps.Polygon({
|
||||
function creaPoligono(coords, color, Geocerca) {
|
||||
var polygon = new google.maps.Polygon({
|
||||
paths: coords,
|
||||
strokeColor: color,
|
||||
strokeOpacity: 0.8,
|
||||
strokeWeight: 2,
|
||||
fillColor: color,
|
||||
fillOpacity: 0.35
|
||||
fillOpacity: 0.35
|
||||
});
|
||||
polygon.setMap(map);
|
||||
polygons.push(polygon);
|
||||
CreaMarcadorPoligono(coords, Geocerca)
|
||||
CreaMarcadorPoligono(coords, Geocerca)
|
||||
}
|
||||
|
||||
function CreaMarcadorPoligono(coords, GeoCerca) {
|
||||
function CreaMarcadorPoligono(coords, GeoCerca) {
|
||||
var bounds = new google.maps.LatLngBounds();
|
||||
for (i = 0; i < coords.length; i++) {
|
||||
bounds.extend(coords[i]);
|
||||
for (i = 0; i < coords.length; i++) {
|
||||
bounds.extend(coords[i]);
|
||||
}
|
||||
|
||||
var marker = new google.maps.Marker({
|
||||
var marker = new google.maps.Marker({
|
||||
position: bounds.getCenter(),
|
||||
title: GeoCerca,
|
||||
map: map
|
||||
map: map
|
||||
});
|
||||
|
||||
var infowindow = new google.maps.InfoWindow({
|
||||
content: '<h4><b>' + GeoCerca + '</b></h4>'
|
||||
var infowindow = new google.maps.InfoWindow({
|
||||
content: '<h4><b>' + GeoCerca + '</b></h4>'
|
||||
});
|
||||
|
||||
marker.addListener('click', function () {
|
||||
marker.addListener('click', function () {
|
||||
closeLastOpenedInfoWindow();
|
||||
infowindow.open(map, marker);
|
||||
lastOpenedInfoWindow = infowindow;
|
||||
lastOpenedInfoWindow = infowindow;
|
||||
});
|
||||
|
||||
markers.push(marker);
|
||||
markers.push(marker);
|
||||
}
|
||||
|
||||
function CenterPoligono(coords) {
|
||||
function CenterPoligono(coords) {
|
||||
var bounds = new google.maps.LatLngBounds();
|
||||
for (i = 0; i < coords.length; i++) {
|
||||
bounds.extend(coords[i]);
|
||||
for (i = 0; i < coords.length; i++) {
|
||||
bounds.extend(coords[i]);
|
||||
}
|
||||
map.fitBounds(bounds)
|
||||
map.fitBounds(bounds)
|
||||
}
|
||||
|
||||
function closeLastOpenedInfoWindow() {
|
||||
if (lastOpenedInfoWindow) {
|
||||
lastOpenedInfoWindow.close();
|
||||
}
|
||||
function closeLastOpenedInfoWindow() {
|
||||
if (lastOpenedInfoWindow) {
|
||||
lastOpenedInfoWindow.close();
|
||||
}
|
||||
}
|
||||
|
||||
function FitBounds() {
|
||||
function FitBounds() {
|
||||
var bounds = new google.maps.LatLngBounds();
|
||||
for (var i = 0; i < polygons.length; i++) {
|
||||
for (var i = 0; i < polygons.length; i++) {
|
||||
var paths = polygons[i].getPaths();
|
||||
paths.forEach(function (path) {
|
||||
paths.forEach(function (path) {
|
||||
var ar = path.getArray();
|
||||
for (var i = 0, l = ar.length; i < l; i++) {
|
||||
bounds.extend(ar[i]);
|
||||
}
|
||||
})
|
||||
for (var i = 0, l = ar.length; i < l; i++) {
|
||||
bounds.extend(ar[i]);
|
||||
}
|
||||
})
|
||||
}
|
||||
for (var i = 0; i < polybounds.length; i++) {
|
||||
bounds.extend(polybounds[i]);
|
||||
for (var i = 0; i < polybounds.length; i++) {
|
||||
bounds.extend(polybounds[i]);
|
||||
}
|
||||
|
||||
for (var i = 0; i < markers.length; i++) {
|
||||
if (markers[i].getVisible()) {
|
||||
bounds.extend(markers[i].getPosition());
|
||||
}
|
||||
for (var i = 0; i < markers.length; i++) {
|
||||
if (markers[i].getVisible()) {
|
||||
bounds.extend(markers[i].getPosition());
|
||||
}
|
||||
}
|
||||
|
||||
map.fitBounds(bounds)
|
||||
map.fitBounds(bounds)
|
||||
}
|
||||
|
||||
function CreaMarcador(coords, nomEquipo, ContentString, imagen) {
|
||||
function CreaMarcador(coords, nomEquipo, ContentString, imagen) {
|
||||
if (typeof imagen === 'undefined') { imagen = image; }
|
||||
var marker = new google.maps.Marker({
|
||||
var marker = new google.maps.Marker({
|
||||
position: coords,
|
||||
title: nomEquipo,
|
||||
map: map,
|
||||
icon: imagen
|
||||
icon: imagen
|
||||
});
|
||||
|
||||
var infowindow = new google.maps.InfoWindow({
|
||||
content: ContentString
|
||||
var infowindow = new google.maps.InfoWindow({
|
||||
content: ContentString
|
||||
});
|
||||
marker.addListener('click', function () {
|
||||
marker.addListener('click', function () {
|
||||
closeLastOpenedInfoWindow();
|
||||
infowindow.open(map, marker);
|
||||
lastOpenedInfoWindow = infowindow;
|
||||
lastOpenedInfoWindow = infowindow;
|
||||
});
|
||||
markers.push(marker);
|
||||
markers.push(marker);
|
||||
}
|
||||
|
||||
function creaPolyline(coords, color, GeoCerca) {
|
||||
var polyline = new google.maps.Polyline({
|
||||
function creaPolyline(coords, color, GeoCerca) {
|
||||
var polyline = new google.maps.Polyline({
|
||||
path: coords,
|
||||
strokeColor: color,
|
||||
strokeOpacity: 0.8,
|
||||
strokeWeight: 2,
|
||||
fillOpacity: 0.35
|
||||
fillOpacity: 0.35
|
||||
});
|
||||
polyline.setMap(map);
|
||||
polylines.push(polyline);
|
||||
polybounds.push(coords[0]);
|
||||
polybounds.push(coords[coords.length - 1]);
|
||||
CreaMarcadorPoligono(coords, GeoCerca);
|
||||
CreaMarcadorPoligono(coords, GeoCerca);
|
||||
}
|
||||
|
||||
function NuevaConsulta() {
|
||||
for (var i = 0; i < polygons.length; i++) {
|
||||
polygons[i].setMap(null);
|
||||
function NuevaConsulta() {
|
||||
for (var i = 0; i < polygons.length; i++) {
|
||||
polygons[i].setMap(null);
|
||||
}
|
||||
polygons = [];
|
||||
for (var i = 0; i < polylines.length; i++) {
|
||||
polylines[i].setMap(null);
|
||||
for (var i = 0; i < polylines.length; i++) {
|
||||
polylines[i].setMap(null);
|
||||
}
|
||||
|
||||
for (var i = 0; i < markers.length; i++) {
|
||||
markers[i].setMap(null);
|
||||
for (var i = 0; i < markers.length; i++) {
|
||||
markers[i].setMap(null);
|
||||
}
|
||||
polylines = [];
|
||||
polybounds = [];
|
||||
markers = [];
|
||||
$("#dvConsulta").modal({ backdrop: 'static', keyboard: false })
|
||||
$("#dvConsulta").modal({ backdrop: 'static', keyboard: false })
|
||||
}
|
||||
|
||||
function fitBoundsToVisibleMarkers() {
|
||||
function fitBoundsToVisibleMarkers() {
|
||||
|
||||
var bounds = new google.maps.LatLngBounds();
|
||||
|
||||
for (var i = 0; i < polygons.length; i++) {
|
||||
bounds.extend(polygons[i].my_getBounds().getCenter())
|
||||
for (var i = 0; i < polygons.length; i++) {
|
||||
bounds.extend(polygons[i].my_getBounds().getCenter())
|
||||
|
||||
}
|
||||
for (var i = 0; i < markers.length; i++) {
|
||||
if (markers[i].getVisible()) {
|
||||
bounds.extend(markers[i].getPosition());
|
||||
}
|
||||
for (var i = 0; i < markers.length; i++) {
|
||||
if (markers[i].getVisible()) {
|
||||
bounds.extend(markers[i].getPosition());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
map.fitBounds(bounds);
|
||||
map.fitBounds(bounds);
|
||||
|
||||
}
|
||||
|
||||
function CargaPickers() {
|
||||
function CargaPickers() {
|
||||
$.datetimepicker.setLocale('es');
|
||||
$('input.ADDateTimePicker').each(function () {
|
||||
$('input.ADDateTimePicker').each(function () {
|
||||
var TThis = $(this);
|
||||
TThis.datetimepicker({
|
||||
TThis.datetimepicker({
|
||||
dayOfWeekStart: 1,
|
||||
lang: 'es',
|
||||
format: 'd/m/Y H:i',
|
||||
formatDate: 'd/m/Y H:i',
|
||||
step: 30
|
||||
step: 30
|
||||
});
|
||||
var Div = TThis.parent()
|
||||
var boton = document.createElement('span');
|
||||
@@ -531,42 +531,42 @@
|
||||
var subboton = document.createElement('a')
|
||||
subboton.className = "btn default"
|
||||
subboton.innerHTML = "<i class='fa fa-calendar'></i>"
|
||||
subboton.addEventListener('click', function () {
|
||||
TThis.datetimepicker('show')
|
||||
subboton.addEventListener('click', function () {
|
||||
TThis.datetimepicker('show')
|
||||
});
|
||||
boton.appendChild(subboton)
|
||||
|
||||
Div[0].appendChild(boton)
|
||||
Div[0].appendChild(boton)
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
function DisplayGV() {
|
||||
if ($("#C_chkUp").prop('checked')) {
|
||||
($("#dvDispositivos").css('display', ''))
|
||||
} else {
|
||||
($("#dvDispositivos").css('display', 'none'))
|
||||
}
|
||||
function DisplayGV() {
|
||||
if ($("#C_chkUp").prop('checked')) {
|
||||
($("#dvDispositivos").css('display', ''))
|
||||
} else {
|
||||
($("#dvDispositivos").css('display', 'none'))
|
||||
}
|
||||
}
|
||||
|
||||
function CargaModal() {
|
||||
$('#C_TxtHoraI').datetimepicker({
|
||||
function CargaModal() {
|
||||
$('#C_TxtHoraI').datetimepicker({
|
||||
datepicker: false,
|
||||
lang: 'es',
|
||||
format: 'H:i',
|
||||
formatDate: 'H:i',
|
||||
step: 30
|
||||
step: 30
|
||||
});
|
||||
$('#C_TxtHoraF').datetimepicker({
|
||||
$('#C_TxtHoraF').datetimepicker({
|
||||
datepicker: false,
|
||||
lang: 'es',
|
||||
format: 'H:i',
|
||||
formatDate: 'H:i',
|
||||
step: 30
|
||||
step: 30
|
||||
});
|
||||
$('#dvEditar').modal()
|
||||
$('#dvEditar').modal()
|
||||
}
|
||||
|
||||
function ShowDiv(controlDiv, map) {
|
||||
@@ -599,35 +599,30 @@
|
||||
controlUI.appendChild(controlText);
|
||||
|
||||
// Setup the click event listeners: simply set the map to Chicago.
|
||||
controlUI.addEventListener('click', function () {
|
||||
FNShowDiv();
|
||||
});
|
||||
controlUI.addEventListener('click', function () {
|
||||
FNShowDiv();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
var open = false;
|
||||
function FNShowDiv() {
|
||||
if (open === false) {
|
||||
function FNShowDiv() {
|
||||
if (open === false) {
|
||||
$("#h").modal()
|
||||
$("#ShowDiv3").css("line-height", "34px")
|
||||
open = true
|
||||
$("#ShowDiv3").html('<i class="fa fa-angle-down" aria-hidden="true"></i>')
|
||||
} else {
|
||||
$("#ShowDiv3").html('<i class="fa fa-angle-down" aria-hidden="true"></i>')
|
||||
} else {
|
||||
$("#h").modal('hide')
|
||||
$("#ShowDiv3").css("line-height", "20px")
|
||||
open = false
|
||||
$("#ShowDiv3").html('<i class="fa fa-angle-up" aria-hidden="true"></i>')
|
||||
}
|
||||
$("#ShowDiv3").html('<i class="fa fa-angle-up" aria-hidden="true"></i>')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
<script
|
||||
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAF7s8wwhzCVXDUYopc9mXxqaWB33cDro4&libraries=places">
|
||||
</script>
|
||||
<%--<script
|
||||
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAJnZ1CoEUX425C20aqzFw4dYxFL_LfThk&libraries=places">
|
||||
</script>--%>
|
||||
<script src="<%= String.Format("https://maps.googleapis.com/maps/api/js?key={0}&libraries=places", Extensiones.GOOGLE_MAPS_API_KEY) %>"</script>
|
||||
</asp:Content>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user