geosolutions-it / ckan

CKAN is an open-source DMS (data management system) for powering data hubs and data portals. CKAN makes it easy to publish, share and use data. It powers the http://thedatahub.org/ and http://data.gov.uk/ among many other sites.
http://ckan.org/
Other
0 stars 2 forks source link

Layer sfondo per anteprima bounding box #18

Closed etj closed 11 years ago

etj commented 11 years ago

Rendere configurabile (e/o documentare) come customizzare il layer usato da CKAN nella visualizzazione del bounding box in VistaRisorsa.

offtherailz commented 11 years ago

Questi setting sono hardcoded, eventuali generalizzazioni per questo non sono complesse ma richiedono tempo. E' possibile modificare una configurazione opzionale inserita nel modulo che fa riferimento a un geoserver inglese: https://github.com/geosolutions-it/ckanext-spatial#configuration---dataset-extent-map La modifica riguarda solo il JavaScript e un parametro di configurazionee la procedura è stata documentata sul documento di intallazione. E' necessaria una minima conoscenza di openlayers

etj commented 11 years ago

Customizzazione del viewer per il bounding box

L’estensione spaziale di ckan non permette una customizzazione fina sulle preview (layer di sfondo etc).Per personalizzare è quindi necessario andare a intervenire sul codice javascript.

Il file da modificare è il seguente ckanext-spatial/ckanext/spatial/public/ckanext/spatial/js/dataset_map.js

Questo file genera la mappa di default (con openStreetMap) e alternativamente una che utilizza un layer wms inglese, che è possibile modificare.

riga 82

} else if (this.map_type=='os') {
               var copyrightStatements = "Contains Ordnance Survey data (c) Crown copyright and database right  [2012] <br>" + "Contains Royal Mail data (c) Royal Mail copyright and database right [2012]<br>" + "Contains bathymetry data by GEBCO (c) Copyright [2012]<br>" + "Contains data by Land & Property Services (Northern Ireland) (c) Crown copyright [2012]";
               // Create a new map
               var layers = [
                 new OpenLayers.Layer.WMS("Geoserver layers - Tiled",
            'http://osinspiremappingprod.ordnancesurvey.co.uk/geoserver/gwc/service/wms', {
                       LAYERS: 'InspireETRS89',
                STYLES: '',
                format: 'image/png',
                tiled: true
                       }, {
                buffer: 0,
                displayOutsideMaxExtent: true,
                isBaseLayer: true,
                attribution: copyrightStatements,
                       transitionEffect: 'resize'
                       }
                 )
               ];
//..altro codice da customizzare riguardo la proiezione etc...

una volta modificato è necessario aggiungere alla configurazione di ckan la riga

ckan.spatial.dataset_extent_map.map_type = os

Vedi:https://github.com/geosolutions-it/ckanext-spatial#configuration---dataset-extent-map