tupali/mapero.php

417 lines
12 KiB
PHP
Raw Normal View History

2016-10-29 15:07:15 +00:00
<?php session_start();
if(isset($_REQUEST['debug'])) {ini_set('display_errors', 'On');}
require ('milfs/xajax/xajax.inc.php');
$xajax = new xajax();
//require ('json.lab.php');
require ('milfs/funciones/funciones.php');
require ("milfs/funciones/conex.php");
//require_once ('includes/markdown.php');
//require ('funciones/convert.php');
$xajax->processRequests();
//if($_REQUEST[id2] =='') {$agregar= $_REQUEST[id];}else {$agregar = $_REQUEST[id2];}
2017-03-17 00:46:38 +00:00
if(isset($_REQUEST[categoria]) AND isset($_REQUEST[buscar])) {
$_REQUEST[buscar] = "$_REQUEST[categoria]:$_REQUEST[buscar]";
}
2016-10-29 15:07:15 +00:00
$formulario_nombre = remplacetas('form_id','id',$_REQUEST[id],'nombre') ;
2017-03-17 00:46:38 +00:00
$formulario_descripcion = remplacetas('form_id','id',$_REQUEST[id],'descripcion') ;
2016-10-29 15:07:15 +00:00
$agregar_nombre = remplacetas('form_id','id',$agregar,'nombre') ;
$id_empresa = remplacetas('form_id','id',$_REQUEST[id],'id_empresa') ;
2017-03-17 00:46:38 +00:00
$logo = remplacetas('empresa','id',"$id_empresa[0]",'imagen','') ;
$razon_social = remplacetas('empresa','id',"$id_empresa[0]",'razon_social','') ;
$campos_formulario = input_campos("$_REQUEST[id]","categoria");
2016-10-29 15:07:15 +00:00
$plantilla ="mapa";
?>
<!DOCTYPE html>
<html lang="en">
<head >
<title><?php echo $formulario_nombre[0] ?> MILFS</title>
<meta charset="utf-8">
2017-03-17 00:46:38 +00:00
<!-- <meta name="viewport" content="user-scalable=no, width=device-width, maximum-scale=1, initial-scale=1"> -->
2016-10-29 15:07:15 +00:00
<meta http-equiv="X-UA-Compatible" content="IE=edge">
2017-03-17 00:46:38 +00:00
<!-- <meta name="viewport" content="width=device-width, initial-scale=1"> -->
2016-10-29 15:07:15 +00:00
<meta name="description" content="">
<?php $xajax->printJavascript("milfs/xajax/"); ?>
<link rel="shortcut icon" href="favicon-152.png">
<link rel="apple-touch-icon-precomposed" href="favicon-152.png">
2017-03-17 00:46:38 +00:00
2016-10-29 15:07:15 +00:00
<link rel="stylesheet" href="librerias/leaflet/leaflet-search.css"/>
2017-05-02 19:35:01 +00:00
<script src="librerias/leaflet/leaflet.js"></script>
2017-05-02 19:48:14 +00:00
<script src="librerias/jquery/jquery-2.1.4.min.js"></script>
2017-05-02 19:35:01 +00:00
<script src="librerias/leaflet/leaflet-providers.js"></script>
<script src="librerias/leaflet/leaflet-search.js"></script>
2017-03-17 00:46:38 +00:00
<link rel="stylesheet" type="text/css" media="screen" href="milfs/css/bootstrap.css">
2017-05-02 19:35:01 +00:00
<link rel="stylesheet" href="librerias/leaflet/leaflet.css" />
<script src="librerias/leaflet/leaflet.js"></script>
2017-03-17 00:46:38 +00:00
2017-05-02 19:35:01 +00:00
<link rel="stylesheet" href="librerias/leaflet/dist/MarkerCluster.css" />
<link rel="stylesheet" href="librerias/leaflet/dist/MarkerCluster.Default.css" />
<script src="librerias/leaflet/dist/leaflet.markercluster-src.js"></script>
2017-03-17 00:46:38 +00:00
<script type="text/javascript" src="milfs/geojson.js.php?id=<?php echo $_REQUEST['id'] ?>&buscar=<?php echo $_REQUEST['buscar'] ?>"></script>
2017-06-24 22:04:40 +00:00
<!-- <script type="text/javascript" src="http://localhost/default/tupali/milfs/geojson.js.php?id=358"></script> -->
<!-- <script type="text/javascript" src="tmp/ruta_paz_territorial.geojson"></script> -->
<?php
$otro_json = remplacetas('form_parametrizacion','campo',$_REQUEST[id],'descripcion'," tabla='form_id' and opcion = 'json'") ;;
//$obj = file_get_contents('https://www.kleper.net/wiki/RutaPazTerritorial.geojson');
$ids = json_decode($otro_json[0]);
foreach ($ids as $clave => $valor) {
if($valor !=""){
$obj=file_get_contents("$valor[0]");
$li .="<script>var geojsonAuxiliar_$clave = $obj ;</script>";
$layer .= "
var geojsonAux_$clave = L.geoJson(geojsonAuxiliar_$clave, {
2017-03-17 00:46:38 +00:00
2017-06-24 22:04:40 +00:00
pointToLayer: function(feature, latlng) {
var smallIcon = new L.Icon({
2017-10-06 23:29:37 +00:00
iconSize: [100, 100],
2017-06-24 22:04:40 +00:00
iconAnchor: [13, 27],
popupAnchor: [1, -24],
/*iconUrl: feature.properties.icon.iconUrl*/
iconUrl: 'https://tupale.co/milfs/images/secure/?file=150/da6d16547658ebc06c5378b30d1ee4bf.png'
});
return L.marker(latlng, {icon: smallIcon});
},
onEachFeature: function(feature, layer) {
var popupText = feature.properties.description
layer.bindPopup(popupText); }
});
";
$add_layer .= "markers.addLayer(geojsonAux_$clave);";
$capas_nombre .="geojsonAux_$clave,";
$capas .= "{
'$clave': geojsonAux_$clave
};";
$overlays ="
var overlays = $capas ";
}
}
//$obj=file_get_contents("$otro_json[0]");
//echo "<script>var geojsonAuxiliar = $obj ;</script>";
echo $li;
?>
2016-10-29 15:07:15 +00:00
<style type="text/css">
@media (max-width: 800px) {
.panel-map{
max-width: 970px;
}
}
@media (min-width: 800px) {
.panel-map{
max-width: 200px;
}
}
.leaflet-popup-content { word-wrap: break-word !important; /*width:600px !important; */ }
#map { position:absolute; top:0; bottom:0; width:100%; }
/* Sticky footer styles
-------------------------------------------------- */
.footer {
position: absolute;
bottom: 3px;
width: 95%;
margin: 0 auto;
height: 120px;
/* Set the fixed height of the footer here */
z-index: 999999;
}
#div_leyenda {
padding: 2px;
background-color: white;
border-radius: 3px;
width: 90%;
overflow-x: scroll;
}
2017-10-06 16:09:19 +00:00
.modal-dialog {
width: 70%;
height: 50%;
2016-10-29 15:07:15 +00:00
padding: 0;
}
.modal-content {
height: 50%;
2016-10-29 15:07:15 +00:00
}
2017-03-17 00:46:38 +00:00
::-webkit-scrollbar {
width: 12px;
}
::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
border-radius: 10px;
}
::-webkit-scrollbar-thumb {
border-radius: 10px;
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.5);
}
2016-10-29 15:07:15 +00:00
</style>
<?php
2017-03-17 00:46:38 +00:00
$categorias = lista_categorias($_REQUEST['id'],'','') ;
2016-10-29 15:07:15 +00:00
$css_adicional = remplacetas('form_parametrizacion','campo',"index",'descripcion'," tabla='css' and opcion = 'adicional' and id_empresa = '$id_empresa[0]'") ;
if($css_adicional[0] !="") {
$css_adicional ="<style >
$css_adicional[0]
<!-- adicional -->
</style>";
}
else {
$css_adicional ="<style ><!-- nada --></style>";
}
echo $css_adicional; ?>
</head>
<body>
2017-03-17 00:46:38 +00:00
<!--nav sidebar -->
<aside>
<nav class="navbar navbar-inverse sidebar navbar-fixed-top" role="navigation">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<link href="librerias/leaflet/css/sidebar.css" rel="stylesheet">
<div class="nav-side-menu">
<div class="brand"><a href="./"><img style='width: 100%;' src='images/banner.png' class='image-responsive'></a><br> <i class="fa fa-info-circle fa-lg pull-right" style="margin-top: 10px; margin-right: 5px;"></i></div>
<i class="fa fa-bars fa-2x toggle-btn" data-toggle="collapse" data-target="#menu-content"></i>
<br>
<form action="?id=<?php echo $_REQUEST[id]; ?>" method="get">
<div class='input-group '>
<input type='hidden' id='id' name='id' value="<?php echo $_REQUEST[id]; ?>" >
<?php echo $campos_formulario; ?><div id='div_campos'></div>
<input type='text' id='buscar' name='buscar' class='form-control' placeholder='Buscar' >
<input type="submit" class="btn btn-info " value="Buscar">
</div>
</form>
<hr>
<div class="menu-list">
<div style='width: calc(90% - 40px);;' class="container-fluid">
<h1><?php echo $formulario_nombre[0]; ?></h1>
<h2><?php echo $formulario_descripcion[0]; ?></h2>
<hr>
<h3>Categorías</h3>
<div style="height: 300px; overflow: auto;" >
<?php echo $categorias; ?>
</div>
<div class="sidebar-logo">
<a href="e<?php echo $id_empresa[0]; ?>" >
<img style='margin: 0px auto;' class='img img-responsive block-center' src="milfs/images/secure/?file=150/<?php echo $logo[0]; ?>" alt="<?php echo $razon_social[0]; ?>">
<h4><?php echo $razon_social[0]; ?></h4>
</a>
</div>
</div>
</div>
</div>
</nav>
</aside>
2016-10-29 15:07:15 +00:00
2017-03-17 00:46:38 +00:00
<div id="map"></div>
<?php
2016-10-29 15:07:15 +00:00
if($categorias !="") {
$pie="
<div style='' class='' id='contenedor_pie' >
<div style='' class='container' >
<a href='#' onclick=\"xajax_limpia_div('contenedor_pie'); \"><span class='pull-right'><i class='fa fa-times'></i></span></a>
$categorias
</div></div>
</div>";
$leyenda ="<div id='div_leyenda'><a class='btn btn-default btn-xs' onclick=xajax_contenido_ocultar('div_leyenda');>Cerrar</a> $categorias </div> ";
}else{
}
//echo $pie;
?>
2017-03-17 00:46:38 +00:00
<script type="text/javascript">
function htmlbodyHeightUpdate(){
var height3 = $( window ).height()
var height1 = $('.nav').height()+50
height2 = $('.main').height()
if(height2 > height3){
$('html').height(Math.max(height1,height3,height2)+10);
$('body').height(Math.max(height1,height3,height2)+10);
}
else
{
$('html').height(Math.max(height1,height3,height2));
$('body').height(Math.max(height1,height3,height2));
}
}
$(document).ready(function () {
htmlbodyHeightUpdate()
$( window ).resize(function() {
htmlbodyHeightUpdate()
});
$( window ).scroll(function() {
height2 = $('.main').height()
htmlbodyHeightUpdate()
});
});
function htmlbodyHeightUpdate(){
var height3 = $( window ).height()
var height1 = $('.nav').height()+50
height2 = $('.main').height()
if(height2 > height3){
$('html').height(Math.max(height1,height3,height2)+10);
$('body').height(Math.max(height1,height3,height2)+10);
}
else
{
$('html').height(Math.max(height1,height3,height2));
$('body').height(Math.max(height1,height3,height2));
}
}
$(document).ready(function () {
htmlbodyHeightUpdate()
$( window ).resize(function() {
htmlbodyHeightUpdate()
});
$( window ).scroll(function() {
height2 = $('.main').height()
htmlbodyHeightUpdate()
});
});
2017-05-02 19:50:36 +00:00
var tiles = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
2017-03-17 00:46:38 +00:00
maxZoom: 18,
2017-06-24 22:04:40 +00:00
attribution: '&copy; <a href="https://openstreetmap.org/copyright">OpenStreetMap</a> contributors'
2017-03-17 00:46:38 +00:00
}),
latlng = L.latLng(4, -74.9005222);
var map = L.map('map', {center: latlng, zoom: 5, layers: [tiles],zoomControl: false});
var geojson = L.geoJson(geojsonSample, {
pointToLayer: function(feature, latlng) {
2016-10-29 15:07:15 +00:00
var smallIcon = new L.Icon({
2017-10-07 19:33:56 +00:00
iconSize: [100, 100],
2016-10-29 15:07:15 +00:00
iconAnchor: [13, 27],
popupAnchor: [1, -24],
iconUrl: feature.properties.icon.iconUrl
2017-06-24 22:04:40 +00:00
/* iconUrl: "http://localhost/default/tupali/milfs/images/secure/?file=150/da6d16547658ebc06c5378b30d1ee4bf.png"*/
2016-10-29 15:07:15 +00:00
});
return L.marker(latlng, {icon: smallIcon});
},
2017-03-17 00:46:38 +00:00
onEachFeature: function(feature, layer) {
2016-10-29 15:07:15 +00:00
var popupText = feature.properties.description
layer.bindPopup(popupText); }
2017-03-17 00:46:38 +00:00
});
2016-10-29 15:07:15 +00:00
/*
var geojsonAux = L.geoJson(geojsonAuxiliar, {
pointToLayer: function(feature, latlng) {
var smallIcon = new L.Icon({
iconSize: [60, 60],
iconAnchor: [13, 27],
popupAnchor: [1, -24],
iconUrl: "http://localhost/default/tupali/milfs/images/secure/?file=150/da6d16547658ebc06c5378b30d1ee4bf.png"
});
return L.marker(latlng, {icon: smallIcon});
},
2017-06-24 22:04:40 +00:00
onEachFeature: function(feature, layer) {
var popupText = feature.properties.description
layer.bindPopup(popupText); }
});
*/
2017-06-24 22:04:40 +00:00
<?php echo $layer; ?>
2017-03-17 00:46:38 +00:00
var markers = L.markerClusterGroup();
markers.addLayer(geojson);
2017-06-24 22:04:40 +00:00
// markers.addLayer(geojsonAux);
<?php echo $add_layer; ?>
2017-03-17 00:46:38 +00:00
map.fitBounds(geojson.getBounds());
2016-10-29 15:07:15 +00:00
var legend = L.control({position: 'bottomright'});
2017-03-17 00:46:38 +00:00
//disable zoomControl when initializing map (which is topleft by default)
2017-06-24 22:04:40 +00:00
///L.control.layers(<?php echo $capas_nombre; ?>).addTo(map);
2016-10-29 15:07:15 +00:00
2017-06-24 22:04:40 +00:00
/* //add zoom control with your options
2017-03-17 00:46:38 +00:00
L.control.zoom({
position:'topright'
}).addTo(map);
2016-10-29 15:07:15 +00:00
2017-06-24 22:04:40 +00:00
*/
2016-10-29 15:07:15 +00:00
legend.onAdd = function (map) {
var div = L.DomUtil.create('div', 'info legend');
2017-03-17 00:46:38 +00:00
div.innerHTML = "";
2016-10-29 15:07:15 +00:00
div.id = "info legend"
return div;
};
legend.addTo(map);
2017-03-17 00:46:38 +00:00
map.addLayer(markers);
2016-10-29 15:07:15 +00:00
2017-03-17 00:46:38 +00:00
</script>
2016-10-29 15:07:15 +00:00
</body>
2017-05-02 18:29:22 +00:00
</html>