[OpenLayers-Dev] Vector layer not shown well in IE7
Damiano Morosi
damiano.morosi at gmail.com
Fri Oct 31 04:38:49 EDT 2008
Hi all,
I have a problem with vetor layer and IE7. The following (simplified) code
works well in Firefox but unsurprisingly not in IE7, where the point is
always displayed at the upper left corner, wherever you position it in the
map.
----
<script
type="text/javascript">
var map, layer, pointLayer,
path;
var result_style =
OpenLayers.Util.applyDefaults({
strokeWidth:
3,
strokeColor:
"#ff0000",
fillOpacity: 100
}, OpenLayers.Feature.Vector.style['default']);
function init(){
var mapOptions = { ... }
map = new OpenLayers.Map( 'map', mapOptions);
layer = new OpenLayers.Layer.TileCache(
"basic",
["http://213.199.15.252/tilecache"],
'basic');
pointLayer = new OpenLayers.Layer.Vector("Zoom",
{styl
e: point_style});
map.addLayers([layer, pointLayer]);
}
function showPoint(lon, lat) {
var point_wkt = 'POINT('+lon+'
'+lat+')';
parser = new
OpenLayers.Format.WKT();
var point_feat =
parser.read(point_wkt);
pointLayer.destroyFeatures();
pointLayer.addFeatures([point_feat]);
map.panTo(new OpenLayers.LonLat(lon, lat));
}
</script>
----
Thank you, please ask if you need more details.
Damiano Morosi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-dev/attachments/20081031/b5ee13f9/attachment.html
More information about the Dev
mailing list