Search in sources :

Example 1 with MultiLineString

use of org.gwtopenmaps.openlayers.client.geometry.MultiLineString in project geo-platform by geosdi.

the class GeoPlatformSRSConverter method multiLineWKTConverter.

/**
 * @param geom
 * @param source
 * @param dest
 * @return
 */
public static String multiLineWKTConverter(Geometry geom, Projection source, Projection dest) {
    MultiLineString multiLine = MultiLineString.narrowToMultiLineString(geom.getJSObject());
    multiLine.transform(source, dest);
    return multiLine.toString();
}
Also used : MultiLineString(org.gwtopenmaps.openlayers.client.geometry.MultiLineString)

Example 2 with MultiLineString

use of org.gwtopenmaps.openlayers.client.geometry.MultiLineString in project geo-platform by geosdi.

the class GPRoutingLine method drawLine.

/**
 * (non-Javadoc)
 *
 * @see
 * org.geosdi.geoplatform.gui.puregwt.routing.event.TraceRoutingLineEventHandler#drawLine(java.lang.String)
 */
@Override
public void drawLine(String wkt) {
    if (this.feature != null) {
        layer.removeFeature(feature);
    }
    MultiLineString geometry = MultiLineString.narrowToMultiLineString(Geometry.fromWKT(wkt).getJSObject());
    if (geoPlatformMap.getMap().getProjection().equals(GPCoordinateReferenceSystem.GOOGLE_MERCATOR.getCode())) {
        geometry.transform(new Projection(GPCoordinateReferenceSystem.WGS_84.getCode()), new Projection(GPCoordinateReferenceSystem.EPSG_GOOGLE.getCode()));
    }
    this.feature = new VectorFeature(geometry);
    this.feature.setStyle(style);
    this.layer.addFeature(feature);
    this.geoPlatformMap.getMap().zoomToExtent(geometry.getBounds());
}
Also used : MultiLineString(org.gwtopenmaps.openlayers.client.geometry.MultiLineString) VectorFeature(org.gwtopenmaps.openlayers.client.feature.VectorFeature) Projection(org.gwtopenmaps.openlayers.client.Projection)

Example 3 with MultiLineString

use of org.gwtopenmaps.openlayers.client.geometry.MultiLineString in project geo-platform by geosdi.

the class MultiLineEditorHandler method checkModifications.

@Override
protected boolean checkModifications(VectorFeature feature) {
    MultiLineString oldMultiLine = MultiLineString.narrowToMultiLineString(modifyEditorControl.getSelectedFeature().getGeometry().getJSObject());
    MultiLineString multiLine = MultiLineString.narrowToMultiLineString(feature.getGeometry().getJSObject());
    return multiLine.equals(oldMultiLine);
}
Also used : MultiLineString(org.gwtopenmaps.openlayers.client.geometry.MultiLineString)

Example 4 with MultiLineString

use of org.gwtopenmaps.openlayers.client.geometry.MultiLineString in project geo-platform by geosdi.

the class WktLineGeometryBuilder method buildWktMultiGeometry.

@Override
protected final String buildWktMultiGeometry(VectorFeature feature) {
    LineString line = LineString.narrowToLineString(feature.getGeometry().getJSObject());
    MultiLineString multiLine = new MultiLineString(new LineString[] { line });
    return multiLine.toString();
}
Also used : MultiLineString(org.gwtopenmaps.openlayers.client.geometry.MultiLineString) MultiLineString(org.gwtopenmaps.openlayers.client.geometry.MultiLineString) LineString(org.gwtopenmaps.openlayers.client.geometry.LineString)

Example 5 with MultiLineString

use of org.gwtopenmaps.openlayers.client.geometry.MultiLineString in project geo-platform by geosdi.

the class MultiLineCoverterHandler method generateGeometryWKT.

@Override
protected String generateGeometryWKT(Geometry geom, Projection dest) {
    MultiLineString mls = MultiLineString.narrowToMultiLineString(geom.getJSObject());
    mls.transform(new Projection(mapWidget.getMap().getProjection()), dest);
    return mls.toString();
}
Also used : MultiLineString(org.gwtopenmaps.openlayers.client.geometry.MultiLineString) Projection(org.gwtopenmaps.openlayers.client.Projection)

Aggregations

MultiLineString (org.gwtopenmaps.openlayers.client.geometry.MultiLineString)5 Projection (org.gwtopenmaps.openlayers.client.Projection)2 VectorFeature (org.gwtopenmaps.openlayers.client.feature.VectorFeature)1 LineString (org.gwtopenmaps.openlayers.client.geometry.LineString)1