[Gvsig_desarrolladores] Mostrar icono
Toni Ramiro
anrapas en gmail.com
Jue Oct 1 10:18:55 CEST 2009
Lo siento, pero el mensaje anterior estaba incompleto.
He realizado una librerÃa que muestra un punto en un mapa. Las instrucciones
que uso para crear el punto y mostrarlo son las siguientes:
View vista = null;
IWindow[] v = PluginServices.getMDIManager().getAllWindows();
for (int i = 0; i < v.length && vista == null; i++)
if (v[i].getWindowInfo().getTitle().equals("Vista : Mapa"))
vista = (View)v[i];
MapContext mapContext = vista.getModel().getMapContext();
MapControl mapControl = new MapControl();
mapControl.setMapContext(mapContext);
GraphicLayer lyr = mapControl.getMapContext().getGraphicsLayer();
FSymbol theSymbol = new FSymbol(FConstant.SYMBOL_TYPE_POINT);
theSymbol.setSize(10);
int idSymbol = lyr.addSymbol(theSymbol);
try {
IGeometry geom = ShapeFactory.createPoint2D(X, Y);
MapControl mapControl;
FGraphic grDibujo = new FGraphic(geom, idSymbol);
lyr.addGraphic(grDibujo);
mapControl.getViewPort().refreshExtent();
} catch (Exception e) {
}
Ahora me gustarÃa sustituir el punto que muestra por un dibujo de (por
ejemplo) un avión. Me imagino que habrá que sustituir la linea en rojo por
otra que cree el simbolo del avión.
¿Sabeis como se hace?
Muchisimas gracias!!!
--
Saludos,
Toni Ramiro
<anrapas en gmail.com>
<aramiro151r en cv.gva.es>
------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: http://listserv.gva.es/pipermail/gvsig_desarrolladores/attachments/20091001/93775297/attachment.htm
More information about the gvSIG_desarrolladores
mailing list