[OpenLayers-Users] ModifyFeatrure Control and vertexRenderIntent
Robert Sanson
Robert.Sanson at asurequality.com
Wed Apr 4 17:27:05 EDT 2012
Hi Carlos,
Perfect!
Thanks,
Robert
>>> Carlos Krefft <ckrefft at rsmas.miami.edu> 5/04/2012 1:10 a.m. >>>
Take a look at this:
http://gis.stackexchange.com/questions/20041/how-to-disable-polygon-label-on
-the-vertices-openlayers-in-edit-mode/20136#20136
Carlos K.
-----Original Message-----
From: openlayers-users-bounces at lists.osgeo.org
[mailto:openlayers-users-bounces at lists.osgeo.org] On Behalf Of Robert Sanson
Sent: Tuesday, April 03, 2012 9:43 PM
To: users at openlayers.org
Subject: [OpenLayers-Users] ModifyFeatrure Control and vertexRenderIntent
I have a polygon vector layer which I have a ModifyFeature control set
against. The default StyleMap for the layer has a label based on a name
property. Unfortunately, I have not been able to turn off the labels for the
vertices when a feature is selected for modification.
Here is my style map:
var crop_style = new OpenLayers.StyleMap({
"default": new OpenLayers.Style(
{
pointRadius: 3,
strokeColor: "#ff6103",
fillColor: "#ffcc99",
fillOpacity: 0.4,
strokeWidth: 2,
label: "${name}",
fontColor: "blue",
fontSize: 10,
fontFamily: "Arial",
fontWeight: "bold"
}),
"temporary": new OpenLayers.Style(
{
pointRadius: 3,
strokeColor: "#ff6103",
fillColor: "#ffcc99",
fillOpacity: 0.4,
strokeWidth: 2,
label: null
}),
"select": new OpenLayers.Style(
{
pointRadius: 3,
strokeColor: "#ff6103",
fillColor: "#0000ff",
fillOpacity: 0.4,
strokeWidth: 2,
label: null,
fontColor: null,
fontSize: null,
fontFamily: null,
fontWeight: null
}),
"vertex": new OpenLayers.Style(
{
pointRadius: 4,
strokeColor: "#ff6103",
fillColor: "#ff0000",
fillOpacity: 0.4,
strokeWidth: 2,
label: null,
fontColor: null,
fontSize: null,
fontFamily: null,
fontWeight: null
})
}, {extendDefault: false}
);
Here are the controls that are specified against the layer:
var fpControls = {
dpoint: new
OpenLayers.Control.DrawFeature(fpts,OpenLayers.Handler.Point),
modify: new OpenLayers.Control.ModifyFeature(fpts,
{vertexRenderIntent: "vertex"}),
delf: new OpenLayers.Control.SelectFeature(fpts, {onSelect:
function(feature) {feature.attributes.pstate = "del";
feature.style = style_fptsdel;
fpts.drawFeature(feature);
}
}
)
};
I don't seem to get the "vertex" renderintent working. The vertices and
pseudovertices all have a label "undefined", which stops me being able to
drag them or delete them.
Any help appreciated.
Thanks,
Robert Sanson
This email and any attachments are confidential and intended solely for the
addressee(s). If you are not the intended recipient, please notify us
immediately and then delete this email from your system.
This message has been scanned for Malware and Viruses by Websense Hosted
Security.
www.websense.com
_______________________________________________
Users mailing list
Users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/openlayers-users
More information about the Users
mailing list