127
| <![CDATA[<script type="text/javascript">
var imageryMap,
lastUri,
pageNumber,
url,
sceneUrl = 'scene/',
geoJsonLayer = {},
lastSelectedLayer,
seeOnMap,
geoJSON;
$(document).ready(function() {
imageryMap = new L.Map('imageryMap', { center: [-15, -52], zoom: 4 });
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'//,
}).addTo(imageryMap);
lastUri = $('#last_uri').attr('value');
pageNumber = $('#page_number').attr('value');
url = "/harpia/geo/?" +
(lastUri ? lastUri : '') +
(pageNumber ? '&page=' + pageNumber : '') +
"&format=json";
$.getJSON(url, function(data) {
geoJSON = L.geoJson(data, {
style: function(feature) {
return { weight: 1 }
},
onEachFeature: function (feature, layer) {
geoJsonLayer[feature.properties.name] = layer;
var html = [
'<p class="scene_title"><strong>',
"<a href='", sceneUrl, feature.properties.name ,"'>",
feature.properties.name,
'</a>',
'</strong>',
'</p>',
'<div class="btn-group btn-group-sm">',
'<div class="btn btn-default">',
'<span class="glyphicon glyphicon-calendar "></span> ',
feature.properties.date.substr(0, 10),
'</div>',
'<div class="btn btn-default">',
'<span class="glyphicon glyphicon-hourglass"></span> ',
feature.properties.status.toUpperCase(),
'</div>',
'</div>'
].join('');
layer.bindPopup(html);
}
});
geoJSON.addTo(imageryMap);
imageryMap.fitBounds(geoJSON);
});
})
</script>]]>
|