cluster map

This commit is contained in:
fredyrivera 2017-02-04 11:46:44 -05:00
parent 11aa408052
commit 287d48cde1
8 changed files with 3057 additions and 42 deletions

View File

@ -0,0 +1,60 @@
.marker-cluster-small {
background-color: rgba(181, 226, 140, 0.6);
}
.marker-cluster-small div {
background-color: rgba(110, 204, 57, 0.6);
}
.marker-cluster-medium {
background-color: rgba(241, 211, 87, 0.6);
}
.marker-cluster-medium div {
background-color: rgba(240, 194, 12, 0.6);
}
.marker-cluster-large {
background-color: rgba(253, 156, 115, 0.6);
}
.marker-cluster-large div {
background-color: rgba(241, 128, 23, 0.6);
}
/* IE 6-8 fallback colors */
.leaflet-oldie .marker-cluster-small {
background-color: rgb(181, 226, 140);
}
.leaflet-oldie .marker-cluster-small div {
background-color: rgb(110, 204, 57);
}
.leaflet-oldie .marker-cluster-medium {
background-color: rgb(241, 211, 87);
}
.leaflet-oldie .marker-cluster-medium div {
background-color: rgb(240, 194, 12);
}
.leaflet-oldie .marker-cluster-large {
background-color: rgb(253, 156, 115);
}
.leaflet-oldie .marker-cluster-large div {
background-color: rgb(241, 128, 23);
}
.marker-cluster {
background-clip: padding-box;
border-radius: 20px;
}
.marker-cluster div {
width: 30px;
height: 30px;
margin-left: 5px;
margin-top: 5px;
text-align: center;
border-radius: 15px;
font: 12px "Helvetica Neue", Arial, Helvetica, sans-serif;
}
.marker-cluster span {
line-height: 30px;
}

14
librerias/leaflet/dist/MarkerCluster.css vendored Executable file
View File

@ -0,0 +1,14 @@
.leaflet-cluster-anim .leaflet-marker-icon, .leaflet-cluster-anim .leaflet-marker-shadow {
-webkit-transition: -webkit-transform 0.3s ease-out, opacity 0.3s ease-in;
-moz-transition: -moz-transform 0.3s ease-out, opacity 0.3s ease-in;
-o-transition: -o-transform 0.3s ease-out, opacity 0.3s ease-in;
transition: transform 0.3s ease-out, opacity 0.3s ease-in;
}
.leaflet-cluster-spider-leg {
/* stroke-dashoffset (duration and function) should match with leaflet-marker-icon transform in order to track it exactly */
-webkit-transition: -webkit-stroke-dashoffset 0.3s ease-out, -webkit-stroke-opacity 0.3s ease-in;
-moz-transition: -moz-stroke-dashoffset 0.3s ease-out, -moz-stroke-opacity 0.3s ease-in;
-o-transition: -o-stroke-dashoffset 0.3s ease-out, -o-stroke-opacity 0.3s ease-in;
transition: stroke-dashoffset 0.3s ease-out, stroke-opacity 0.3s ease-in;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -118,6 +118,7 @@
France: {
url: '//{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png',
options: {
maxZoom: 20,
attribution: '© Openstreetmap France | {attribution.OpenStreetMap}'
}
},
@ -143,7 +144,7 @@
}
},
Thunderforest: {
url: '//{s}.tile.thunderforest.com/{variant}/{z}/{x}/{y}.png',
url: '//{s}.tile.thunderforest.com/{variant}/{z}/{x}/{y}.png?apikey={apikey}',
options: {
attribution:
'&copy; <a href="http://www.thunderforest.com/">Thunderforest</a>, {attribution.OpenStreetMap}',
@ -209,39 +210,6 @@
RoadsAndLabels: 'roads_and_labels'
}
},
MapQuestOpen: {
/* Mapquest does support https, but with a different subdomain:
* https://otile{s}-s.mqcdn.com/tiles/1.0.0/{type}/{z}/{x}/{y}.{ext}
* which makes implementing protocol relativity impossible.
*/
url: 'http://otile{s}.mqcdn.com/tiles/1.0.0/{type}/{z}/{x}/{y}.{ext}',
options: {
type: 'map',
ext: 'jpg',
attribution:
'Tiles Courtesy of <a href="http://www.mapquest.com/">MapQuest</a> &mdash; ' +
'Map data {attribution.OpenStreetMap}',
subdomains: '1234'
},
variants: {
OSM: {},
Aerial: {
options: {
type: 'sat',
attribution:
'Tiles Courtesy of <a href="http://www.mapquest.com/">MapQuest</a> &mdash; ' +
'Portions Courtesy NASA/JPL-Caltech and U.S. Depart. of Agriculture, Farm Service Agency'
}
},
HybridOverlay: {
options: {
type: 'hyb',
ext: 'png',
opacity: 0.9
}
}
}
},
MapBox: {
url: '//api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}',
options: {
@ -281,17 +249,15 @@
Terrain: {
options: {
variant: 'terrain',
minZoom: 4,
maxZoom: 18,
bounds: [[22, -132], [70, -56]]
minZoom: 0,
maxZoom: 18
}
},
TerrainBackground: {
options: {
variant: 'terrain-background',
minZoom: 4,
maxZoom: 18,
bounds: [[22, -132], [70, -56]]
minZoom: 0,
maxZoom: 18
}
},
TopOSMRelief: {
@ -562,7 +528,7 @@
}
},
BasemapAT: {
url: '//maps{s}.wien.gv.at/basemap/{variant}/normal/google3857/{z}/{y}/{x}.{format}',
url: 'https://maps{s}.wien.gv.at/basemap/{variant}/normal/google3857/{z}/{y}/{x}.{format}',
options: {
maxZoom: 19,
attribution: 'Datenquelle: <a href="www.basemap.at">basemap.at</a>',
@ -572,7 +538,12 @@
variant: 'geolandbasemap'
},
variants: {
basemap: 'geolandbasemap',
basemap: {
options: {
maxZoom: 20, // currently only in Vienna
variant: 'geolandbasemap'
}
},
grau: 'bmapgrau',
overlay: 'bmapoverlay',
highdpi: {
@ -583,6 +554,7 @@
},
orthofoto: {
options: {
maxZoom: 20, // currently only in Vienna
variant: 'bmaporthofoto30cm',
format: 'jpeg'
}
@ -662,6 +634,30 @@
maxZoom: 18,
subdomains: '0123',
}
},
JusticeMap: {
// Justice Map (http://www.justicemap.org/)
// Visualize race and income data for your community, county and country.
// Includes tools for data journalists, bloggers and community activists.
url: 'http://www.justicemap.org/tile/{size}/{variant}/{z}/{x}/{y}.png',
options: {
attribution: '<a href="http://www.justicemap.org/terms.php">Justice Map</a>',
// one of 'county', 'tract', 'block'
size: 'county',
// Bounds for USA, including Alaska and Hawaii
bounds: [[14, -180], [72, -56]]
},
variants: {
income: 'income',
americanIndian: 'indian',
asian: 'asian',
black: 'black',
hispanic: 'hispanic',
multi: 'multi',
nonWhite: 'nonwhite',
white: 'white',
plurality: 'plural'
}
}
};

17
milfs/geojson.js Normal file
View File

@ -0,0 +1,17 @@
<?php
if(isset($_REQUEST['debug'])) {ini_set('display_errors', 'On');}
require ('xajax/xajax.inc.php');
$xajax = new xajax();
require ('funciones/funciones.php');
require ('funciones/convert.php');
require ("funciones/conex.php");
$geojson = imprime_geojson("$_REQUEST[id]","","mapa","$_REQUEST[buscar]");
//header('Content-Type: application/json');
var geojsonSample =
echo $geojson;
;
?>

17
milfs/geojson.js.php Normal file
View File

@ -0,0 +1,17 @@
<?php
if(isset($_REQUEST['debug'])) {ini_set('display_errors', 'On');}
require ('xajax/xajax.inc.php');
$xajax = new xajax();
require ('funciones/funciones.php');
require ('funciones/convert.php');
require ("funciones/conex.php");
$geojson = imprime_geojson("$_REQUEST[id]","","mapa","$_REQUEST[buscar]");
//header('Content-Type: application/json');
echo "var geojsonSample = ";
echo $geojson;
echo ";"
?>

230
nomapa.php Normal file
View File

@ -0,0 +1,230 @@
<?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><?php echo $formulario_nombre[0] ?> MILFS</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">
<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: 2px;
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('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
maxZoom: 18,
attribution: '&copy; <a href="http://osm.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);
</script>
</body>
</html>