Hi and thanks to all the replies in advance,
<br><br>I am relatively new to tilecache. I have installed it on
windows and it works fine, but the problem is that is when i want to
add an openlayers marker, well it just doesn't display it. It displays
it when I am not using tilecache to cache the image tiles.<br><br>Here is my html.<br><br><html xmlns="<a href="http://www.w3.org/1999/xhtml" target="_blank">http://www.w3.org/1999/xhtml</a>"><br> <head><br>
<style type="text/css"><br>
#map {<br> width: 100%;<br> height: 99%;<br> border: 1px solid black;<br> }<br> body {<br> padding:0px; <br> margin:2px<br> }<br> #labs {<br> position:absolute;<br>
bottom:15px;<br> left:7px;<br> font-size:smaller;<br> z-index: 5000;<br> } <br> </style><br> <script src="<a href="http://openlayers.org/api/OpenLayers.js" target="_blank">http://openlayers.org/api/OpenLayers.js</a>"></script><br>
<!--<script type="text/javascript" src="C:/Tomcat6/webapps<div id="1fmg" class="ArwC7c ckChnd">/examples/Whitesnow/js/main_actions_1.0.js"></script>--><br> <script type="text/javascript"><br>
<!--<br>
var lon = 5;<br> var lat = 40;<br> var zoom = 5;<br> var points = [];<br> var map, layer, polygonLayer, markers, points_ring, area_of_interest_polygon, area_of_interest_feature, ol_wms, mouse;<br>
var icon_size = new OpenLayers.Size(1700,1700);<br> <br> var coords_lat = new Array();<br> var coords_lon = new Array();<br> <br> var vector_style = OpenLayers.Util.extend({}, OpenLayers.Feature.Vector.style['default']);<br>
vector_style.strokeColor = "#7F0000"; <br> vector_style.fillColor = "red"; <br> <br> function init(){<br> var options = {<br> units: "m",<br>
projection: 'epsg:32661',<br>
resolutions:
[5500000.0,2750000.0,1375000.0,687500.0,343750.0,171875.0,85937.5,
42968.75,21484.375,10742.1875,5371.09375,2685.546875,1342.7734375,671.38671875,335.693359375,167.8466796875,83.92333984375,41.961669921875,20.9808349609375,10.49041748046875],<br>
maxExtent: new OpenLayers.Bounds(-2200000,-712631,3072800,3840000)<br> };<br> var options2 = {<br> units: "m",<br> maxResolution: "auto",<br>
projection: "EPSG:3573",<br>
resolutions: [5500000.0, 2750000.0, 1375000.0, 687500.0, 343750.0,
171875.0, 85937.5, 42968.75, 21484.375, 10742.1875, 5371.09375,
2685.546875, 1342.7734375, 671.38671875, 335.693359375, 167.8466796875,
83.92333984375, 41.961669921875, 20.9808349609375, 10.49041748046875],<br>
maxExtent: new OpenLayers.Bounds(-4000000,-4200000,3000000,3500000)<br> };<br> map = new OpenLayers.Map( 'map');<br><br> ol_wms = new OpenLayers.Layer.WMS( "OpenLayers WMS", <br>
"<a href="http://labs.metacarta.com/wms/vmap0?" target="_blank">http://labs.metacarta.com/wms/vmap0?</a>", {layers: 'basic', srs: 'epsg:42304'}); <br><br> polygonLayer = new OpenLayers.Layer.Vector("Polygon Layer");<br>
markers = new OpenLayers.Layer.Markers( "Markers" );<br> <br> <br><br> layer = new OpenLayers.Layer.WMS( "Openlayers WMS", <br> "<a href="http://lakeice.uwaterloo.ca/TileCache-2.01/tilecache.cgi?" target="_blank">http://lakeice.uwaterloo.ca/TileCache-2.01/tilecache.cgi?</a>", {layers: 'nsidc_polar', format: 'image/png' },options2 );<br>
<br> map.addLayer(ol_wms); <br> <br> // map.addControl(new OpenLayers.Control.Permalink());<br> if (!map.getCenter()) map.zoomToMaxExtent();<br> <br> <br>
<br> mouse = new OpenLayers.Control.MousePosition();<br> map.addControl(mouse);<br> <br> // markers.clearMarkers();<br> //var marker = new OpenLayers.Marker(new OpenLayers.LonLat(0, 0), new OpenLayers.Icon("<a href="http://lakeice.uwaterloo.ca/TileCache-2.01/target2.png" target="_blank">http://lakeice.uwaterloo.ca/TileCache-2.01/target2.png</a>", icon_size));<br>
//markers.addMarker(new OpenLayers.Marker(new OpenLayers.LonLat(0, 0), new OpenLayers.Icon("<a href="http://lakeice.uwaterloo.ca/TileCache-2.01/target2.png" target="_blank">http://lakeice.uwaterloo.ca/TileCache-2.01/target2.png</a>", icon_size)));<br>
// markers.addMarker(new OpenLayers.Marker(new OpenLayers.LonLat(-5859.37500, -27734.37500), new OpenLayers.Icon("<a href="http://lakeice.uwaterloo.ca/TileCache-2.01/target2.png" target="_blank">http://lakeice.uwaterloo.ca/TileCache-2.01/target2.png</a>", icon_size)));<br>
<br> map.events.register("click", map, function(e) {<br> if (coords_lon.length < 4) {<br> // alert("no");<br> var lonlat = map.getLonLatFromViewPortPx(e.xy);<br>
coords_lon.push(lonlat.lon);<br> coords_lat.push(lonlat.lat);<br> // setOutputPoints();<br> drawUniversalSelection();<br> }<br> });<br> <br> <br>
}<br> <br> function drawUniversalSelection() {<br> <br> points.length = 0;<br> markers.clearMarkers();<br> for (var x = 0; x < coords_lon.length; x++) {<br>
var marker = new OpenLayers.Marker(new OpenLayers.LonLat(coords_lon[x],
coords_lat[x]), new OpenLayers.Icon("target2.png", icon_size));<br>
points[x] = new OpenLayers.Geometry.Point(coords_lon[x], coords_lat[x]);<br> markers.addMarker(marker);<br> map.addLayer(markers);<br> //alert("yep");<br> <br> }<br>
<br> if (coords_lon.length > 1) {<br> points.push(points[0]);<br> // alert("yep");<br> }<br> points_ring = new OpenLayers.Geometry.LinearRing(points);<br>
area_of_interest_polygon = new OpenLayers.Geometry.Polygon(points_ring);<br> area_of_interest_feature = new OpenLayers.Feature.Vector(area_of_interest_polygon,null,vector_style);<br> polygonLayer.destroyFeatures();<br>
polygonLayer.addFeatures([area_of_interest_feature]);<br> map.addLayer(polygonLayer);<br> <br> } <br> // --><br> </script><br> </head><br> <body onload="init()"><br>
<div id="map"><br> <div id="labs">From <a href="<a href="http://labs.metacarta.com/" target="_blank">http://labs.metacarta.com/</a>">MetaCarta Labs</a>.</div><br>
</div><br>
</body><br></html><br><br><br>Thanks in advance,<br><br><br>Aleks</div>