[OpenLayers-Users] GeoJSON layer and modifyFeature control

Adorian Ardelean mynature at gmail.com
Thu Dec 4 13:53:06 EST 2008


Hi Eric,

No...it is not working yet. There is some improvement indeed: I can see now
the selection style, but vertexes are still not editable.

I have tried to adapt the suggestion in post I have mentioned earlier.

var styleMap = new OpenLayers.StyleMap();

var rules = [new OpenLayers.Rule({
symbolizer: template,
elseFilter: true
})];
styleMap.styles["default"].addRules(rules);

Using this the edit polygon works!!!. However, I did not figured out how to
include "context" within this. Select style is also not visible (but I do
not mind this, I can most probably find a work around for selection style).

Initially I have used:
var mystyle = new OpenLayers.Style(template, {context: context});
var styleMap = new OpenLayers.StyleMap(mystyle);
And context worked fine.

Any hints on how to include context with rules?

Thank you,
Adorian



On Thu, Dec 4, 2008 at 5:58 PM, Eric Lemoine <eric.c2c at gmail.com> wrote:

> Hello
>
> Try:
>
> new OpenLayers.StyleMap({
>    "default": yourStyle
> });
>
> Hope this helps,
>
> Eric
>
> 2008/12/4, Adorian Ardelean <mynature at gmail.com>:
> > Hi again,
> >
> > I have eliminated also the context for style as a source of problem for
> the
> > modifyFeature control not working. So it seems that just by specifying a
> > styleMap as option when declaring the vector layer makes the
> modifyFeature
> > control not functional.
> >
> > var template = {
> >     fillOpacity: 0.6,
> >     fillColor: "red",
> >     strokeColor:"orange",
> >     strokeWidth:"1"
> >     };
> >
> > var mystyle = new OpenLayers.Style(template);
> >
> > var regions = new
> OpenLayers.Layer.Vector("regions",{extractAttributes:true,
> > format: OpenLayers.Format.GeoJSON, projection: new
> > OpenLayers.Projection("EPSG:4326"), styleMap: new
> > OpenLayers.StyleMap(mystyle)});
> >
> >
> > I think the solution might be somewhere in the post:
> > StyleMap and ModifyFeatures aren't compatible ?I will give it a try.
> >
> > All the best,
> > Adorian
> >
> >
> > Dr. Adorian Ardelean
> > coordinator of myNature Project
> >
> > http://mybiosis.info/nature/portal.php?pagename=firstpage [a Romanian
> > biodiversity-database]
> > http://mybiosis.info/nature/portal.php?pagename=adorian [CV]
> >
>



-- 
Dr. Adorian Ardelean
coordinator of myNature Project

proiectul myNature
str. Rascoala din 1907 nr 12
Timisoara 300523
Romania

http://mybiosis.info/nature/portal.php?pagename=firstpage [a Romanian
biodiversity-database]
http://mybiosis.info/nature/portal.php?pagename=adorian [CV]


Projects in which I was involved:
http://hercules.kgs.ku.edu/Hexacoral/Anemone2/ [Hexacorallians of the World]
http://www.ubio.org [uBio Project]
http://portal.ubio.org [uBio Portal]
http://microscope.mbl.edu [micro*scope Project]
http://starcentral.mbl.edu/biopedia [BioPedia]
http://starcentral.mbl.edu/custar [CU*STAR]
http://planktonnet.awi.de/index.php [planktonNet]

Yahoo messenger: transylvaniasan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20081204/c9e9279b/attachment.html


More information about the Users mailing list