mejoras en nomap.php

This commit is contained in:
fredyrivera 2017-03-05 11:14:30 -05:00
parent d5267c8128
commit 05e4ec3a95
7 changed files with 431 additions and 7 deletions

View File

@ -0,0 +1,35 @@
.leaflet-control-slidemenu{
cursor: pointer;
}
.leaflet-menu{
position: absolute;
background-color: rgba(255, 255, 255, 0.5);
overflow: auto;
cursor: default;
z-index: 9999;
opacity: 0,5;
}
.leaflet-menu::-webkit-scrollbar{
width: 7px;
height: 7px;
background: #f2f2f2;
}
.leaflet-menu::-webkit-scrollbar-thumb{
border-radius: 2px;
background: #777;
}
.leaflet-menu-close-button{
background-color: transparent;
border: none;
font-size: 14pt;
color: #777;
cursor: pointer;
}
.leaflet-menu-close-button:hover{
color: #4285F4;
}

View File

@ -0,0 +1,148 @@
L.Control.SlideMenu = L.Control.extend({
options: {
position: 'topleft',
menuposition: 'topleft', // topleft,topright,bottomleft,bottomright
width: '300px',
height: '100%',
direction: 'horizontal', // vertical or horizontal
changeperc: '10',
delay: '10'
},
initialize: function (innerHTML, options) {
L.Util.setOptions(this, options);
this._innerHTML = innerHTML;
this._isLeftPosition = this.options.menuposition == 'topleft' ||
this.options.menuposition == 'bottomleft' ? true : false;
this._isTopPosition = this.options.menuposition == 'topleft' ||
this.options.menuposition == 'topright' ? true : false;
this._isHorizontal = this.options.direction == 'horizontal' ? true : false;
},
onAdd: function (map) {
this._container = L.DomUtil.create('div', 'leaflet-control-slidemenu leaflet-bar leaflet-control');
var link = L.DomUtil.create('a', 'leaflet-bar-part leaflet-bar-part-single', this._container);
link.title = 'Menu';
L.DomUtil.create('span', 'fa fa-info', link);
this._menu = L.DomUtil.create('div', 'leaflet-menu', map._container);
this._menu.style.width = this.options.width;
this._menu.style.height = this.options.height;
if (this._isHorizontal){
var frominit = -(parseInt(this.options.width, 10));
if (this._isLeftPosition){
this._menu.style.left = '-' + this.options.width;
} else {
this._menu.style.right = '-' + this.options.width;
}
if (this._isTopPosition) {
this._menu.style.top = '0px';
} else {
this._menu.style.bottom = '0px';
}
} else {
var frominit = -(parseInt(this.options.height, 10));
if (this._isLeftPosition){
this._menu.style.left = '0px';
} else {
this._menu.style.right = '0px';
}
if (this._isTopPosition) {
this._menu.style.top = '-' + this.options.height;
} else {
this._menu.style.bottom = '-' + this.options.height;
}
}
var closeButton = L.DomUtil.create('button', 'leaflet-menu-close-button fa', this._menu);
if (this._isHorizontal){
if (this._isLeftPosition) {
closeButton.style.float = 'right';
L.DomUtil.addClass(closeButton, 'fa-chevron-left');
}
else {
closeButton.style.float = 'left';
L.DomUtil.addClass(closeButton, 'fa-chevron-right');
}
} else {
if (this._isTopPosition) {
closeButton.style.float = 'right';
L.DomUtil.addClass(closeButton, 'fa-chevron-up');
}
else {
closeButton.style.float = 'right';
L.DomUtil.addClass(closeButton, 'fa-chevron-down');
}
}
this._contents = L.DomUtil.create('div', 'leaflet-menu-contents', this._menu);
this._contents.innerHTML = this._innerHTML;
this._contents.style.clear = 'both';
if (this._isHorizontal){
var ispx = this.options.width.slice(-1) == 'x' ? true : false;
var unit = parseInt(this.options.width, 10) * parseInt(this.options.changeperc, 10) / 100;
} else {
var ispx = this.options.height.slice(-1) == 'x' ? true : false;
var unit = parseInt(this.options.height, 10) * parseInt(this.options.changeperc, 10) / 100;
}
L.DomEvent.disableClickPropagation(this._menu);
L.DomEvent
.on(link, 'click', L.DomEvent.stopPropagation)
.on(link, 'click', function() {
// Open
this._animate(this._menu, frominit, 0, true, ispx, unit);
}, this)
.on(closeButton, 'click', L.DomEvent.stopPropagation)
.on(closeButton, 'click', function() {
// Close
this._animate(this._menu, 0, frominit, false, ispx, unit);
}, this);
return this._container;
},
onRemove: function(map){
//Remove sliding menu from DOM
map._container.removeChild(this._menu);
delete this._menu;
},
setContents: function(innerHTML) {
this._innerHTML = innerHTML;
this._contents.innerHTML = this._innerHTML;
},
_animate: function(menu, from, to, isOpen, ispx, unit) {
if (this._isHorizontal){
if (this._isLeftPosition){
menu.style.left = from + (ispx ? 'px' : '%');
} else {
menu.style.right = from + (ispx ? 'px' : '%');
}
} else {
if (this._isTopPosition) {
menu.style.top = from + (ispx ? 'px' : '%');
} else {
menu.style.bottom = from + (ispx ? 'px' : '%');
}
}
if (from != to){
setTimeout(function(slideMenu) {
var value = isOpen ? from + unit : from - unit;
slideMenu._animate(slideMenu._menu, value, to, isOpen, ispx, unit);
}, parseInt(this.options.delay), this);
} else {
return;
}
}
});
L.control.slideMenu = function(innerHTML, options) {
return new L.Control.SlideMenu(innerHTML, options);
}

View File

@ -18,9 +18,11 @@ if(isset($_REQUEST['debug'])) {ini_set('display_errors', 'On');}
<meta http-equiv="Cache-control" content="public">
<meta charset="UTF-8">
<meta name="viewport" content="user-scalable=no, width=device-width, maximum-scale=1, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="viewport" content="width=590">
<!-- Chrome, Firefox OS y Opera -->

View File

@ -3185,8 +3185,9 @@ if (mysqli_num_rows($sql)!='0'){
mysqli_data_seek($sql, 0);
$fila=1;
$divider=6;
$divider=3;
$cols = (12/$divider);
$sm = 4;
$i =0;
while( $row = mysqli_fetch_array( $sql ) ) {
if($i % $divider==0) {
@ -3203,7 +3204,7 @@ while( $row = mysqli_fetch_array( $sql ) ) {
// $slogan= substr($row[slogan],0, $length = 100)."";
$slogan = $row['slogan'];
$contenido ="
<div class='proyecto col-md-$cols' title=''>
<div class='proyecto col-md-$cols col-sm-$cols' title=''>
<div class='div_proyecto'>
<a href='e$row[id_empresa]' data-toggle='modal' data-target='#myModal'>
<div class='proyecto_titulo' style='
@ -3231,7 +3232,7 @@ while( $row = mysqli_fetch_array( $sql ) ) {
<p class='lead'>Conoce los proyectos que usan Tupale.co para la implementación de sus herramientas, selecciona para conocer más</p>
</div>
<div class='container-fluid'>
<div class='col-sm-10 col-sm-offset-1'>
<div class='col-sm-8 col-sm-offset-2'>
$encontrados
<!-- Modal para contenido de paso colombia-->
<div class='modal fade' id='myModal' tabindex='-1' role='dialog' aria-labelledby='myModalLabel'>

View File

@ -207,6 +207,7 @@ onEachFeature: function(feature, layer) {
var markers = L.markerClusterGroup();
markers.addLayer(geojson);
map.fitBounds(geojson.getBounds());
var legend = L.control({position: 'bottomright'});

237
nomapak.php Normal file
View File

@ -0,0 +1,237 @@
<?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];}
$formulario_nombre = remplacetas('form_id','id',$_REQUEST[id],'nombre') ;
$agregar_nombre = remplacetas('form_id','id',$agregar,'nombre') ;
$id_empresa = remplacetas('form_id','id',$_REQUEST[id],'id_empresa') ;
$plantilla ="mapa";
?>
<!DOCTYPE html>
<html lang="en">
<head >
<title>Mapa <?php echo $formulario_nombre[0] ?></title>
<meta charset="utf-8">
<meta name="viewport" content="user-scalable=no, width=device-width, maximum-scale=1, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<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">
<link rel="stylesheet" href="librerias/leaflet/leaflet-search.css"/>
<script src="librerias/leaflet/leaflet.js"></script>
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="librerias/leaflet/leaflet-providers.js"></script>
<script src="librerias/leaflet/leaflet-search.js"></script>
<link rel="stylesheet" type="text/css" media="screen" href="milfs/css/bootstrap.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.0.3/leaflet.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.0.3/leaflet.js"></script>
<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>
<script type="text/javascript" src="milfs/geojson.js.php?id=<?php echo $_REQUEST['id'] ?>&buscar=<?php echo $_REQUEST['buscar'] ?>"></script>
<link rel="stylesheet" type="text/css" media="screen" href="milfs/css/bootstrap.css">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
<link rel="stylesheet" href="librerias/leaflet/L.Control.SlideMenu.css">
<script src="librerias/leaflet/L.Control.SlideMenu.js"></script>
<style type="text/css">
.navbar-default {
background:rgba(255,255,255,1) ;
}
@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
-------------------------------------------------- */
html {
position: relative;
min-height: 100%;
}
body {
/* Margin bottom by footer height */
margin-bottom: 60px;
padding: 0; margin: 0;
}
/* Custom page CSS
-------------------------------------------------- */
/* Not required for template or sticky footer method. */
body > .container {
padding: 60px 15px 0;
}
.container .text-muted {
margin: 20px 0;
}
.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: 6px;
background-color: white;
border-radius: 3px;
width: 90%;
overflow-x: scroll;
}
code {
font-size: 80%;
}
.modal-dialog {
width: 70%;
height: 50%;
padding: 0;
}
.modal-content {
height: 50%;
}
</style>
<?php
$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>
<div id="map"></div>
<?php $categorias = lista_categorias($_REQUEST['id'],'','') ;
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;
?>
<script type="text/javascript">
var tiles = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: 18,
attribution: '&copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors'
}),
latlng = L.latLng(4, -74.9005222);
var map = L.map('map', {center: latlng, zoom: 5, layers: [tiles]});
var geojson = L.geoJson(geojsonSample, {
pointToLayer: function(feature, latlng) {
var smallIcon = new L.Icon({
iconSize: [60, 60],
iconAnchor: [13, 27],
popupAnchor: [1, -24],
iconUrl: feature.properties.icon.iconUrl
});
return L.marker(latlng, {icon: smallIcon});
},
onEachFeature: function(feature, layer) {
var popupText = feature.properties.description
layer.bindPopup(popupText); }
});
var markers = L.markerClusterGroup();
markers.addLayer(geojson);
// var legend = L.control({position: 'bottomright'});
// legend.onAdd = function (map) {
//var div = L.DomUtil.create('div', 'info legend');
//div.innerHTML = "<?php echo $leyenda; ?> <a class='btn btn-info btn-xs' onclick=\"xajax_contenido_show('div_leyenda'); \"><span class=''>Leyenda</span></a>";
//div.id = "info legend"
//return div;
//};
//legend.addTo(map);
map.addLayer(markers);
// right
var left = '<h2>Creditos</h2>';
var right = '<h2>Titulo MAPA</h2>';
var contents = '<hr>';
contents += 'When you click the menu button and the menu is displayed to slide.<br>';
contents += 'Please set the innerHTML to slide menu.</p>';
var contents2 = '<hr>';
contents2 += '<h3>Categorias</h3>';
contents2 += "<?php echo $leyenda; ?> <a class='btn btn-info btn-xs' onclick=\"xajax_contenido_show('div_leyenda'); \"><span class=''>Leyenda</span></a>";
/// L.control.slideMenu(left + contents).addTo(map);
var slideMenu = L.control.slideMenu('', {position: 'topright', menuposition: 'topright', delay: '50'}).addTo(map);
slideMenu.setContents(right + contents2 );
</script>
</body>
</html>

View File

@ -72,8 +72,8 @@ height: 250px;
.img-gris{
-webkit-filter: grayscale(100%) blur(3px) ;
height: 200px;
width: 200px;
max-height: 200px;
max-width: 200px;
z-index:10;
transition:filter 0.2s;
-webkit-transition:-webkit-filter 1s;