He estado siguiendo este tutorial: http://workshop.pgrouting.org/chapters/geoext_client.html#select-the-start-and-final-destination
Contiene una Openlayers.De Control.DrawFeatures de control definido en el ejemplo de código siguiente. También puede ver las líneas donde el autor comenta "si queremos aplicar un estilo especial para el punto de inicio debemos hacer esto aquí". Problema: no sé cómo aplicar un estilo en esta configuración y no puede encontrar ejemplos de utilización de DrawFeatures de control de esta manera.
¿Cómo puedo tener el punto de inicio de uso de un estilo diferente que el punto final usando este DrawFeatures de control?
DrawPoints = OpenLayers.Class(OpenLayers.Control.DrawFeature, {
// this control is active by default
autoActivate: true,
initialize: function(layer, options) {
// only points can be drawn
var handler = OpenLayers.Handler.Point;
OpenLayers.Control.DrawFeature.prototype.initialize.apply(
this, [layer, handler, options]
);
},
drawFeature: function(geometry) {
OpenLayers.Control.DrawFeature.prototype.drawFeature.apply(
this, arguments
);
if (this.layer.features.length == 1) {
// we just draw the startpoint
// note: if we want to apply a special style to the
// start point we should do this here
} else if (this.layer.features.length == 2) {
// we just draw the finalpoint
// note: if we want to apply a special style to the
// final point we should do this here
// we have all what we need; we can deactivate ourself.
this.deactivate();
}
}
});