63 lines
2.6 KiB
PHTML
Executable File
63 lines
2.6 KiB
PHTML
Executable File
<?php
|
|
//$config = Zend_Registry::get('config');
|
|
$this->headTitle($this->config->title->site);
|
|
$this->headTitle($this->config->title->metadata);
|
|
$this->headTitle("空间浏览");
|
|
$this->headTitle()->setSeparator(' - ');
|
|
$this->headLink()->appendStylesheet('/css/metadata.css');
|
|
$this->breadcrumb('<a href="/">首页</a>');
|
|
$this->breadcrumb('<a href="/metadata">数据产品与服务</a>');
|
|
$this->breadcrumb('<a href="/metadata/tag">空间浏览</a>');
|
|
if (!empty($this->codename)) $this->breadcrumb($this->codename);
|
|
$this->breadcrumb()->setSeparator(' > ');
|
|
$this->headScript()->appendFile('/js/OpenLayers.js');
|
|
$this->headLink()->appendStylesheet('/js/theme/default/style.css');
|
|
?>
|
|
<script src='http://maps.google.com/maps?file=api&v=2&key=ABQIAAAACD-MqkkoOm60o_dvwdcKVhThiRESR0xRCe9JKd36EL3glTk0OxTsRzifkUWmTTrYWaE7dY1lYUlGxA'></script>
|
|
<div id='tools'>
|
|
<?= $this->partial('metadata/tools.phtml'); ?>
|
|
</div>
|
|
<div id='leftnav'>
|
|
</div>
|
|
<div id='map' style="clear:left;height:400px;border:1px;"></div>
|
|
<script type="text/javascript">
|
|
var map;
|
|
|
|
map = new OpenLayers.Map('map');
|
|
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
|
|
|
var gphy = new OpenLayers.Layer.Google(
|
|
"Google Physical",
|
|
{type: G_PHYSICAL_MAP}
|
|
);
|
|
var gmap = new OpenLayers.Layer.Google(
|
|
"Google Streets" // the default
|
|
);
|
|
var ghyb = new OpenLayers.Layer.Google(
|
|
"Google Hybrid",
|
|
{type: G_HYBRID_MAP}
|
|
);
|
|
var gsat = new OpenLayers.Layer.Google(
|
|
"Google Satellite",
|
|
{type: G_SATELLITE_MAP}
|
|
);
|
|
var ol_wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
|
|
"http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'} );
|
|
|
|
map.addLayers([ol_wms,gphy, gmap, ghyb, gsat]);
|
|
map.setCenter(new OpenLayers.LonLat(102, 36), 4);
|
|
|
|
var ajax=new OpenLayers.Ajax.Request('/metadata/json<?php echo $this->params; ?>',{method:'get',onSuccess:featureresult});
|
|
function featureresult(response){
|
|
var feature1= eval('(' + response.responseText + ')');
|
|
//alert(feature1.type);
|
|
var geojson_format = new OpenLayers.Format.GeoJSON();
|
|
var vector_layer = new OpenLayers.Layer.Vector('metadata');
|
|
map.addLayer(vector_layer);
|
|
vector_layer.addFeatures(geojson_format.read(feature1));
|
|
var sf = new OpenLayers.Control.SelectFeature(vector_layer);
|
|
map.addControl(sf);
|
|
sf.activate();
|
|
}
|
|
</script>
|