[OpenLayers-Dev] Vector layer not shown well in IE7

Damiano Morosi damiano.morosi at gmail.com
Fri Oct 31 05:05:41 EDT 2008


New update: the problem is present also if you add more than 1 point feature
in the same vector layer. The first point is placed well, the second... no.

2008/10/31 Damiano Morosi <damiano.morosi at gmail.com>

> I correct: the problem is present only if you add two point features on two
> different vector layers.
> Stay tuned...
>
> 2008/10/31 Damiano Morosi <damiano.morosi at gmail.com>
>
> 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/6ad45040/attachment.html


More information about the Dev mailing list