[OpenLayers-Users] GeoJson serialize and ModifyFeautre

Mark Turek markturek at yahoo.com
Fri Aug 3 09:04:57 PDT 2012


Hey Alexandre!

Thanks a lot. So easy now!

Mark


________________________________
 From: Alexandre Dubé <adube at mapgears.com>
To: Mark Turek <markturek at yahoo.com> 
Cc: openlayers-users at lists.osgeo.org 
Sent: Friday, August 3, 2012 10:46 AM
Subject: Re: [OpenLayers-Users] GeoJson serialize and ModifyFeautre
 

Hey Mark,

  I got something.  Instead of setting the vector layer features
      property directly, use the addFeatures() method to add new
      features :

    //vectors.features = geojson.read(serialized);
    vectors.addFeatures(geojson.read(serialized));

  If you want to remove all current features first, call :
    vectors.removeAllFeatures();

HTH,

Alexandre


On 12-08-03 11:38 AM, Alexandre Dubé wrote:

Hi Mark,
>
>  Don't forget to include the list in CC so that others can see
        the progression of your issue.
>
>Regards,
>
>Alexandre
>
>On 12-08-03 11:25 AM, Mark Turek wrote:
>
>Hi Alexandre!
>>
>>
>>Thank you for you answer. Attached you will find a little example program.
>>
>>
>>Mark
>>
>>
>>
>>________________________________
>> From: Alexandre Dubé <adube at mapgears.com>
>>To: openlayers-users at lists.osgeo.org 
>>Sent: Friday, August 3, 2012 7:13 AM
>>Subject: Re: [OpenLayers-Users] GeoJson serialize and ModifyFeautre
>> 
>>
>>Hi Mark,
>>
>>  Could you provide a minimized test case showing
                    the problem then ?  Pasting some code would be nice
                    but sharing a live demo would be even better.
>>
>>  Here's a good "how to create a minimized test
                    case" : http://docs.openlayers.org/help/minimize.html
>>
>>Regards,
>>
>>Alexandre
>>
>>On 12-08-02 10:28 PM, Mark Turek wrote:
>>
>>I am using 2.12 version. Here is the problem I have. 
>>>If I draw a polygon, selecting it with ModifyFeature works fine. If I serialize the layer features and then read them back in through deserialization ModifyFeature never selects anything and stops working.
>>>Serialization/Deserialization is done through OpenLayers.Format.GeoJSON.
>>>
>>>
>>>Any clue what is happening?
>>>
>>>
>>>_______________________________________________
Users mailing list Users at lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/openlayers-users 
>>
>>
>>-- 
Alexandre Dubé
Mapgears www.mapgears.com 
>>_______________________________________________
>>Users mailing list
>>Users at lists.osgeo.org
>>http://lists.osgeo.org/mailman/listinfo/openlayers-users
>>
>>
>>
>
>
>-- 
Alexandre Dubé
Mapgears www.mapgears.com 
>
>
>_______________________________________________
Users mailing list Users at lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/openlayers-users 


-- 
Alexandre Dubé
Mapgears www.mapgears.com 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20120803/af3fdcbb/attachment-0001.html>


More information about the Users mailing list