[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[udig-devel] RE: Problems adding a layer programmatically
|
David,
I have used the CRS of the map to set the layer (and not have to set it
temporarily in the layer view)
e.g.
/* set the layer CRS - same as the map */
currentActiveMap.getEditManagerInternal().getSelectedLayer().setCRS(currentActiveMap.getViewportModelInternal().getCRS());
Pete
David Fleig wrote:
>
> I made a change to the code and I think I have it working now:
>
> Feature f = createLocationFeature(CMH, "cmh1");
> resource =
> CatalogPlugin.getDefault().getLocalCatalog().createTemporaryResource(f.getFe
> atureType());
> FeatureStore mds;
> try
> {
> mds = resource.resolve(FeatureStore.class,
> null);
> List myFeatures = new LinkedList();
> myFeatures.add(f);
> FeatureReader fReader = new
> CollectionFeatureReader(myFeatures,f.getFeatureType());
> mds.setFeatures(fReader);
> }
> catch (Exception e)
> {
> e.printStackTrace();
> }
>
>
>
> _______________________________________________
> User-friendly Desktop Internet GIS (uDig)
> http://udig.refractions.net
> http://lists.refractions.net/mailman/listinfo/udig-devel
>
>
--
View this message in context: http://www.nabble.com/Feature-Selection-using-example-tf3116329.html#a8639983
Sent from the udig-devel mailing list archive at Nabble.com.