[Geojs-users] deleting layers in geojs 0.8.0

David Manthey david.manthey at kitware.com
Thu Mar 17 12:04:27 EDT 2016


The tiles example will delete and recreate the tile layer if you change
certain properties.  The reprojection example does this, too.

On Thu, Mar 17, 2016 at 12:03 PM, David Manthey <david.manthey at kitware.com>
wrote:

> Yes, but you don't need to call layer.clear() if you are deleting the
> layer, as the layer destructor (called in map.deleteLayer) will call it.
>
> On Thu, Mar 17, 2016 at 12:00 PM, Michael Grauer <
> michael.grauer at kitware.com> wrote:
>
>> Hi GeoJsers,
>>
>> I'm seeing some weird behavior during a Minerva refactor, which is likely
>> on my end, but I'd like to take the opportunity to get the blessed version
>> of deleting layers in GeoJs.
>>
>> My GeoJs map is 'map', and I'm creating multiple feature layers, and also
>> some WMS layers.
>>
>> I've done various combinations of calling 'map.deleteLayer',
>> 'layer.clear', 'map.draw' to try deleting feature layers.  What is the
>> correct way to do it?
>>
>> e.g. to create and then delete a layer would I do:
>>
>> var map = geo.map({whatever})
>> var layer = map.createLayer('feature');
>> layer.clear();
>> map.deleteLayer(layer);
>> map.draw();
>>
>>
>> Thanks
>>
>>
>> _______________________________________________
>> Geojs-users mailing list
>> Geojs-users at public.kitware.com
>> http://public.kitware.com/mailman/listinfo/geojs-users
>>
>>
>
>
> --
> David Manthey
> R&D Engineer
> Kitware Inc.
> (518) 881-4439
>



-- 
David Manthey
R&D Engineer
Kitware Inc.
(518) 881-4439
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/geojs-users/attachments/20160317/515f92c0/attachment.html>


More information about the Geojs-users mailing list