Query example (first 5 results)
/api/3/action/datastore_search?resource_id=7af201fd-083d-41e1-bccf-06695e35fa54&limit=5
/api/3/action/datastore_search?resource_id=7af201fd-083d-41e1-bccf-06695e35fa54&q=public
var query = new PublicaMundi.Data.Query(endpoint);
query.setCallback(callback);
query.resource('7af201fd-083d-41e1-bccf-06695e35fa54', 'table1').take(50);
query.execute({
success: onSuccess,
failure: onFailure,
complete: onComplete
});
Query example in JSON (using the PublicaMundi API)
{
"queue": [
{
"resources": [
{
"name": "7af201fd-083d-41e1-bccf-06695e35fa54",
"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: 'oreines_lekanes_2hs_taxhs (WMS)',
name: 'oreines_lekanes_2hs_taxhs (WMS)',
type: PublicaMundi.LayerType.WMS,
url: 'http://geodata.gov.gr/geoserver/ows',
params: { 'layers' : 'geodata.gov.gr:7af201fd-083d-41e1-bccf-06695e35fa54'},
}
]
};
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