Package show
Query example (first 5 results)
/api/3/action/datastore_search?resource_id=326b7fce-18a8-4248-bdf2-6df8b01b3554&limit=5
/api/3/action/datastore_search?resource_id=326b7fce-18a8-4248-bdf2-6df8b01b3554&q=public
var query = new PublicaMundi.Data.Query(endpoint);
query.setCallback(callback);
query.resource('326b7fce-18a8-4248-bdf2-6df8b01b3554', 'table1').take(50);
query.execute({
success: onSuccess,
failure: onFailure,
complete: onComplete
});
Query example in JSON (using the PublicaMundi API)
{
"queue": [
{
"resources": [
{
"name": "326b7fce-18a8-4248-bdf2-6df8b01b3554",
"alias": "table1"
}
],
"filters": [],
"sort": [],
"offset": 0,
"limit": 50
}
]
}
You can find detailed Data API demos here
<html>
<head>
<!-- Necessary scripts -->
<script src="http://labs.geodata.gov.gr/mapping-api/lib/jQuery/jquery-2.1.0.min.js"></script>
<script src="http://labs.geodata.gov.gr/mapping-api/lib/bootstrap/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="http://labs.geodata.gov.gr/mapping-api/lib/bootstrap/css/bootstrap.css" />
<link rel="stylesheet" href="http://labs.geodata.gov.gr/mapping-api/lib/PublicaMundi/build/lib/ol/ol3-layerswitcher.css" />
<link rel="stylesheet" href="http://labs.geodata.gov.gr/mapping-api/lib/PublicaMundi/build/lib/ol/ol.css" />
<!-- <link rel="stylesheet" href="content/css/default.css" />-->
<!-- PublicaMundi API script -->
<script src="http://labs.geodata.gov.gr/mapping-api/lib/PublicaMundi/build/publicamundi.js" data-library="ol"></script>
</head>
<body>
<div id="popup"></div>
<div id="map" class="map"></div>
</body>
<script>
PublicaMundi.noConflict();
//Popup handling with Bootstrap
var onFeatureClick = function(features, coordinate) {
if (features) {
feature = features [0];
}
if (popup) {
map.setOverlayPosition(popup, coordinate);
$(document.getElementById('popup')).popover('destroy');
var text = JSON.stringify(feature);
$(document.getElementById('popup')).popover({
'placement' : 'top',
'animation' : true,
'html' : true,
'content' : text
}).attr('data-original-title');
$(document.getElementById('popup')).popover('show');
}
};
// Map initialization options
var options = {
target: 'map',
center: [2548716, 4643375],
zoom: 6,
layerControl: true,
layers: [
{
title: 'Open Street Maps',
type: PublicaMundi.LayerType.TILE,
url: 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'
},
{
title: 'aktogrammh (WMS)',
name: 'aktogrammh (WMS)',
type: PublicaMundi.LayerType.WMS,
url: 'http://geodata.gov.gr/geoserver/ows',
params: { 'layers' : 'geodata.gov.gr:326b7fce-18a8-4248-bdf2-6df8b01b3554'},
}
]
};
var map, popup;
PublicaMundi.ready(function () {
//Initialize map with provided options
map = PublicaMundi.map(options);
//Initialize popup handler
popup = map.addOverlay(document.getElementById('popup'));
$(document.getElementById('map')).click(function() {
$(document.getElementById('popup')).popover('destroy');
});
});
</script>
</html>
You can find detailed Mapping API demos here