2020-04-06 03:03:19 +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 " );
include ( 'milfs/librerias/parsedown/Parsedown.php' );
//require_once ('includes/markdown.php');
//require ('funciones/convert.php');
$xajax -> processRequests ();
//if($_REQUEST[id2] =='') {$agregar= $_REQUEST[id];}else {$agregar = $_REQUEST[id2];}
if ( isset ( $_REQUEST [ 'categoria' ]) AND isset ( $_REQUEST [ 'buscar' ])) {
$cadena_busqueda = " $_REQUEST[buscar] " ;
$_REQUEST [ 'buscar' ] = " $_REQUEST[categoria] : $_REQUEST[buscar] " ;
}
$formulario_nombre = remplacetas ( 'form_id' , 'id' , $_REQUEST [ id ], 'nombre' , " " , " " ) ;
$formulario_descripcion = remplacetas ( 'form_id' , 'id' , $_REQUEST [ id ], 'descripcion' , " " , " " ) ;
$descripcion_meta = preg_replace ( " [ \n | \r | \n \r | \t ] " , '' , strip_tags ( $formulario_descripcion [ 0 ]));
$agregar_nombre = remplacetas ( 'form_id' , 'id' , $agregar , 'nombre' , " " , " " ) ;
$id_empresa = remplacetas ( 'form_id' , 'id' , $_REQUEST [ id ], 'id_empresa' , " " , " " ) ;
$twitter = remplacetas ( 'empresa' , 'id' , " $id_empresa[0] " , 'twitter' , '' , " " , " " ) ;
if ( $twitter [ 0 ] == " " ) { $twitter [ 0 ] = " @tupaleCo " ;}
$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 " );
$uri = " $_SERVER[SERVER_NAME] / $_SERVER[REQUEST_URI] " ;
$background_imagen = buscar_imagen ( " $_REQUEST[id] " , " " , " " , " $id_empresa " );
$plantilla = " mapa " ;
$categorias = lista_categorias ( $_REQUEST [ 'id' ], '' , 'mapa' ) ;
2020-04-06 13:35:32 +00:00
$proveedor_mapa = remplacetas ( 'form_parametrizacion' , 'campo' , $_REQUEST [ 'id' ], 'descripcion' , " tabla='form_id' and opcion = 'proveedor_mapa' " ) ;;
if ( $proveedor_mapa [ 0 ] != " " ){
$proveedor = " ' $proveedor_mapa[0] ' " ;
} else {
$proveedor = " 'http:// { s}.tile.openstreetmap.org/ { z}/ { x}/ { y}.png' " ;
2020-04-06 03:03:19 +00:00
2020-04-06 13:35:32 +00:00
}
2020-04-06 03:03:19 +00:00
$buscador = "
< form action = '?id=' $_REQUEST [ id ] ' method=' get ' >
< input type = 'hidden' id = 'id' name = 'id' value = '$_REQUEST[id]' >
$campos_formulario '
< div id = 'div_campos' ></ div >
< input type = 'text' id = 'buscar' name = 'buscar' class = 'form-control ' placeholder = 'Buscar' >
< br >
< input type = 'submit' class = 'btn btn-info btn-block ' value = 'Buscar' >
</ form >
< hr >
" ;
?>
<! DOCTYPE html >
< html lang = " en " >
< head >
< title >< ? php echo " $formulario_nombre[0] / $cadena_busqueda " ?> tupale.co</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 = " " >
< meta NAME = " Language " CONTENT = " Spanish " >
2020-04-06 21:57:47 +00:00
2020-04-06 03:03:19 +00:00
< meta NAME = " Revisit " CONTENT = " 1 days " >
< meta NAME = " Distribution " CONTENT = " Global " >
< meta NAME = " Robots " CONTENT = " All " >
< meta name = " twitter:card " content = " summary " >
< meta name = " twitter:site " content = " <?php echo $twitter[0] ; ?> " >
< meta name = " twitter:creator " content = " @qwerty_co " >
< meta name = " twitter:url " content = " <?php echo $uri ; ?> " >
< meta name = " twitter:title " content = " <?php echo " $formulario_nombre [ 0 ] / $cadena_busqueda " ?> tupale.co " >
< meta name = " twitter:description " content = " <?php echo $descripcion_meta ; ?> " >
< meta name = " twitter:image " content = " <?php echo " $_SESSION [ url ] images / secure / ? file = full / $background_imagen " ; ?> " >
< meta property = " og:type " content = " article " >
< meta property = " og:title " content = " <?php echo " $formulario_nombre [ 0 ] / $cadena_busqueda " ?> tupale.co " />
< meta property = " og:type " content = " website " />
< meta property = " og:url " content = " <?php echo " $uri " ; ?> " />
< meta property = " og:image " content = " <?php echo " $_SESSION [ url ] images / secure / ? file = full / $background_imagen " ; ?> " />
< meta property = " og:site_name " content = " <?php echo $razon_social[0] ; ?> " />
< meta property = " og:description " content = " <?php echo $descripcion_meta ; ?> " />
< link rel = " shortcut icon " href = " <?php echo " milfs / images / secure / ? file = 150 / $logo [ 0 ] " ; ?> " >
< ? 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.css " />
2020-04-06 21:57:47 +00:00
< script src = " milfs/js/scripts.js " ></ script >
2020-04-06 03:03:19 +00:00
< ? 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 , {
pointToLayer : function ( feature , latlng ) {
var smallIcon = new L . Icon ({
iconSize : [ 100 , 100 ],
iconAnchor : [ 13 , 27 ],
popupAnchor : [ 1 , - 24 ],
2020-04-07 02:13:02 +00:00
className : 'mapIcon' ,
2020-04-06 03:03:19 +00:00
/*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 " ;
}
}
echo $li ;
?>
< meta name = " viewport " content = " width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no " >
< link href = " librerias/font-awesome/css/font-awesome.min.css " rel = " stylesheet " >
< link rel = " stylesheet " href = " librerias/leaflet/css/leaflet-sidebar.css " />
< link rel = " stylesheet " href = " librerias/bootstrap/css/bootstrap.min.css " />
2020-04-07 02:13:02 +00:00
< ? php
$hoja_css = remplacetas ( 'form_parametrizacion' , 'campo' , " index " , 'descripcion' , " tabla='hoja_css' and opcion = 'hoja_css' and id_empresa = ' $id_empresa[0] ' " ) ;
if ( $hoja_css [ 0 ] == " " ){ $hoja_estilo = " <link href='./milfs/css/style.css' rel='stylesheet'> " ;}
else { $hoja_estilo = " <link href=' $hoja_css[0] ' rel='stylesheet'> " ;}
print $hoja_estilo ;
$css_adicional = remplacetas ( 'form_parametrizacion' , 'campo' , " index " , 'descripcion' , " tabla='css' and opcion = 'adicional' and id_empresa = ' $empresa[0] ' " ) ;
if ( $css_adicional [ 0 ] != " " ) {
$css_adicional = " <style >
$css_adicional [ 0 ]
</ style > " ;
}
2020-04-06 03:03:19 +00:00
2020-04-07 02:13:02 +00:00
print $css_adicional ;
?>
2020-04-06 03:03:19 +00:00
< style >
body {
padding : 0 ;
margin : 0 ;
}
html , body , #map {
height : 100 % ;
}
</ style >
</ head >
< body onload = " " >
2020-04-06 21:57:47 +00:00
<!-- modal -->
< div class = 'modal fade ' id = 'muestraInfo' tabindex = '-1' role = 'dialog' aria - labelledby = 'myModalLabel' aria - hidden = 'true' data - backdrop = 'static' data - keyboard = 'false' >
< div class = 'modal-dialog modal-MD' style = '' >
< div class = 'modal-content' >
< div class = 'modal-header' >
< button type = 'button' class = 'close' data - dismiss = 'modal' aria - hidden = 'true' >& times ; </ button >
< h4 class = 'modal-title' id = 'myModalLabel_info' >< div id = 'titulo_modal' ></ div ></ h4 >
</ div >
< div class = 'modal-body' >
< div id = 'muestra_form' ></ div >
</ div >
< div class = 'modal-footer' id = 'pie_modal' >
</ div >
</ div >
</ div >
</ div >
<!-- modal -->
2020-04-06 03:03:19 +00:00
<!-- optionally define the sidebar content via HTML markup -->
< div id = " sidebar " class = " leaflet-sidebar collapsed " >
<!-- nav tabs -->
2020-04-06 12:02:04 +00:00
< div class = " leaflet-sidebar-tabs " >
2020-04-06 03:03:19 +00:00
<!-- top aligned tabs -->
< ul role = " tablist " >
< li >< a href = " #home " role = " tab " >< i class = " fa fa-bars active " ></ i ></ a ></ li >
< li >< a href = " #search " role = " tab " >< i class = " fa fa-search active " ></ i ></ a ></ li >
</ ul >
<!-- bottom aligned tabs -->
< ul role = " tablist " >
< li >< a href = " https://tupale.co " >< img title = 'Powered by Tupale.co' alt = 'http://tupale.co' class = 'img img-responsive' src = 'https://tupale.co/images/icons/icon-152x152.png' ></ a ></ li >
</ ul >
</ div >
<!-- panel content -->
< div class = " leaflet-sidebar-content " >
< div class = " leaflet-sidebar-pane " id = " home " >
< h1 class = " leaflet-sidebar-header " >
< span id = 'formulario_titulo_mapa' >< ? php echo $formulario_nombre [ 0 ] ?> </span>
< span class = " leaflet-sidebar-close " >< i class = " fa fa-caret-left " ></ i ></ span >
</ h1 >
< hr >
< label id = 'formulario_descripcion_mapa' >< ? php echo $formulario_descripcion [ 0 ] ?> </label>
< center >
< a href = '/g<?php echo $_REQUEST[id]; ?>' target = '_blank' class = " btn btn-default btn-xs " >< i class = " fa fa-plus-circle " aria - hidden = " true " ></ i > Agregar </ a > < br >
< span class = " label label-warning " > Despues de agregar , recarga el mapa </ span >
</ center >
< hr >
< ? php echo $categorias ; ?>
</ div >
< div class = " leaflet-sidebar-pane " id = " search " >
< label > Buscar en el Mapa </ label >
< ? php echo $buscador ; ?>
</ div >
</ div >
</ div >
< div id = " map " ></ div >
< script src = " librerias/leaflet/leaflet.js " crossorigin = " " ></ script >
< script src = " librerias/leaflet/leaflet-providers.js " ></ script >
< script src = " librerias/leaflet/js/leaflet-sidebar.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 >
2020-04-06 21:57:47 +00:00
< script src = " https://code.jquery.com/jquery-3.3.1.js " ></ script >
< script src = " ./librerias/bootstrap/js/bootstrap.min.js " ></ script >
<!-- < script src = " librerias/jquery/jquery-2.1.4.min.js " ></ script > -->
2020-04-06 04:14:19 +00:00
< ? php $cadena_busqueda = $_REQUEST [ 'buscar' ]; ?>
2020-04-06 03:59:00 +00:00
< script type = " text/javascript " src = " milfs/geojson.js.php?id=<?php echo $_REQUEST['id'] ?>&buscar=<?php echo $cadena_busqueda ?>&item=<?php echo $_REQUEST['item'] ?> " ></ script >
2020-04-06 03:03:19 +00:00
< script src = " https://unpkg.com/leaflet-responsive-popup@0.6.4/leaflet.responsive.popup.js " ></ script >
< link rel = " stylesheet " href = " https://unpkg.com/leaflet-responsive-popup@0.6.4/leaflet.responsive.popup.css " />
< script >
2020-04-06 03:36:25 +00:00
// standard leaflet map setup ??
2020-04-06 03:03:19 +00:00
var map = L . map ( 'map' );
// map.setView([51.2, 7], 9);
2020-04-06 13:35:32 +00:00
// L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
//L.tileLayer.provider('Stamen.Watercolor').addTo(map);
L . tileLayer ( < ? php echo $proveedor ; ?> , {
2020-04-06 03:03:19 +00:00
maxZoom : 19 ,
attribution : " Map data © OpenStreetMap contributors <a href='https://tupale.co'>Powered by Tupale.co</a> "
}) . addTo ( map );
var geojson = L . geoJson ( geojsonSample , {
pointToLayer : function ( feature , latlng ) {
var smallIcon = new L . Icon ({
2020-04-07 02:13:02 +00:00
iconSize : [ 70 , 70 ],
2020-04-06 03:03:19 +00:00
iconAnchor : [ 13 , 27 ],
popupAnchor : [ 1 , - 24 ],
autoPanPadding : [ 30 , 30 ],
2020-04-07 02:13:02 +00:00
className : 'mapIcon' ,
2020-04-06 03:03:19 +00:00
iconUrl : feature . properties . icon . iconUrl
});
return L . marker ( latlng , { icon : smallIcon });
},
onEachFeature : function ( feature , layer ) {
layer . _leaflet_id = feature . properties . control ;
var popupText = L . responsivePopup () . setContent ( feature . properties . description );
layer . bindPopup ( popupText , {
maxWidth : 200
});
layer . bindTooltip ( feature . properties . title ) . openTooltip ();
}
});
< ? php echo $layer ; ?>
// markers.addLayer(geojsonAux);
var markers = L . markerClusterGroup ();
// var markers = L.layerGroup();
markers . addLayer ( geojson ) . addTo ( map );
< ? php echo $add_layer ; ?>
map . fitBounds ( geojson . getBounds () . pad ( Math . sqrt ( 2 ) / 4 ));
// create the sidebar instance and add it to the map
var sidebar = L . control . sidebar ({ container : 'sidebar' , autopan : true })
. addTo ( map )
. open ( 'home' );
function openMarkerPopup ( e ){
const markerID = e . id ;
const marker = markers . getLayer ( markerID );
marker . openPopup ();
}
2020-04-06 21:57:47 +00:00
function onMapClick ( e ) {
var coordenadas = " " + e . latlng . lat + " | " + e . latlng . lng ;
setCookie ( 'ubicacion' , coordenadas , 1 );
// alert("You clicked the map at " + e.latlng);
sidebar . close ();
2020-04-06 23:09:59 +00:00
xajax_formulario_embebido_ajax ( " " , " <?php echo $_REQUEST[id] ; ?> " , " " , " " );
2020-04-06 21:57:47 +00:00
}
map . on ( 'click' , onMapClick );
2020-04-06 03:03:19 +00:00
// add panels dynamically to the sidebar
sidebar . on ( 'content' , function ( ev ) {
switch ( ev . id ) {
case 'autopan' :
sidebar . options . autopan = true ;
break ;
default : sidebar . options . autopan = true ;
}
});
</ script >
< script language = " JavaScript " >
if ( screen . width < 1024 )
//codigo resolución pequeña
sidebar . close ();
else
sidebar . open ();
</ script >
</ body >
</ html >