The source code of my index.php file...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Mapnik WMS Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="style.css" type="text/css" />
<style type="text/css">
body {margin: 0px;}
#map {
width: 1024px;
height: 768px;
}
</style>
<script src="
http://localhost/OpenLayers/lib/OpenLayers.js"></script>
<script type="text/javascript">
var lon = 5;
var lat = 40;
var zoom = 5;
var map, layer;
function init(){
map = new OpenLayers.Map('map', {
controls: [
new OpenLayers.Control.Navigation(),
new OpenLayers.Control.PanZoomBar(),
new OpenLayers.Control.LayerSwitcher({'ascending':false}),
new OpenLayers.Control.Permalink(),
new OpenLayers.Control.ScaleLine(),
new OpenLayers.Control.Permalink('permalink'),
new OpenLayers.Control.MousePosition(),
new OpenLayers.Control.OverviewMap(),
new OpenLayers.Control.KeyboardDefaults(),
new OpenLayers.Control.NavToolbar()
],
numZoomLevels: 19
});
layer = new OpenLayers.Layer.WMS( "maxmap", "
http://localhost/tilecache21/tilecache.py?", {layers: 'maxmap', format:'image/png' }
);
map.addLayer(layer);
//KML
map.addLayer(new OpenLayers.Layer.GML("KML", "poi.kml",
{
format: OpenLayers.Format.KML,
formatOptions: {
extractStyles: true,
extractAttributes: true
}
}));
selectControl = new OpenLayers.Control.SelectFeature(map.layers[1],
{onSelect: onFeatureSelect, onUnselect: onFeatureUnselect});
map.addControl(selectControl);
selectControl.activate();
map.zoomToMaxExtent();
map.fractionalZoom = true;
map.setCenter(new OpenLayers.LonLat(63, 41), 6);
}
function onPopupClose(evt) {
selectControl.unselect(selectedFeature);
}
function onFeatureSelect(feature) {
selectedFeature = feature;
popup = new OpenLayers.Popup.FramedCloud("chicken",
feature.geometry.getBounds().getCenterLonLat(),
new OpenLayers.Size(100,100),
"<div style='font-size:.8em'>"+feature.attributes.name+"<br>"+feature.attributes.description+"</div>",
null, true, onPopupClose);
feature.popup = popup;
map.addPopup(popup);
}
function onFeatureUnselect(feature) {
map.removePopup(feature.popup);
feature.popup.destroy();
feature.popup = null;
}
</script>
</head>
<body onload="init()">
<h2 style="position:absolute; z-index:10000; left: 100px;">Mapnik SimpleCGI as WMS Test</h2>
<div id="map">
</div>
<!--<div style="font-size: small; left:10px; position:absolute; bottom: 30px; z-index:10000;overflow: auto;">
Sample WMS Request:<br /> <input type="textarea" size= "100%" id='info'/>
--></div>
<div id="debug" style="font-size: large; right:10px; position:absolute; bottom: 30px; z-index:10000;"></div>
</body>
</html>
FreemanUz wrote:
Hello,
We developed special XML file for Mapnik. Its working great when
we render it without Tilecache. But we have to use our map for GPS
tracking project and we have to make a cache using Tilecache. While
caching with Tilecache, some parts of some layers are missing or some
parts of lines are drawing incorrectly. You can see it in attached
screenshots. Please tell us what is the problem here and how we can
fix it?
Thanks,
Freeman