Package org.geomajas.gwt.client.map

Examples of org.geomajas.gwt.client.map.MapModel


  @Override
  protected void selectRectangle(Bbox selectedArea) {
    // we can clear here !
    if (!shiftOrCtrl) {
      MapModel mapModel = mapWidget.getMapModel();
      mapModel.clearSelectedFeatures();
    }
    GwtCommand commandRequest = new GwtCommand(SearchByLocationRequest.COMMAND);
    SearchByLocationRequest request = new SearchByLocationRequest();
    request.setLayerIds(getSelectionLayerIds());
    for (Layer<?> layer : mapWidget.getMapModel().getLayers()) {
View Full Code Here


    // we can clear here (but remember the selected feature for the special case of single selection) !
    final String singleSelectionId = mapWidget.getMapModel().getSelectedFeature();
    if (clearSelection) {
      mapWidget.getMapModel().clearSelectedFeatures();
    }
    MapModel mapModel = mapWidget.getMapModel();
    Coordinate worldPosition = mapModel.getMapView().getWorldViewTransformer().viewToWorld(coordinate);
    GwtCommand commandRequest = new GwtCommand(SearchByLocationRequest.COMMAND);
    SearchByLocationRequest request = new SearchByLocationRequest();
    Layer<?> layer = mapModel.getSelectedLayer();
    if (priorityToSelectedLayer && layer != null && layer instanceof VectorLayer) {
      if (!layer.isShowing()) {
        return;
      }
      request.setLayerIds(new String[] { layer.getServerLayerId() });
      request.setFilter(layer.getServerLayerId(), ((VectorLayer) layer).getFilter());
    } else {
      request.setLayerIds(getVisibleServerLayerIds(mapModel));
    }
    Point point = mapModel.getGeometryFactory().createPoint(worldPosition);
    request.setLocation(GeometryConverter.toDto(point));
    request.setCrs(mapWidget.getMapModel().getCrs());
    request.setQueryType(SearchByLocationRequest.QUERY_INTERSECTS);
    request.setSearchType(SearchByLocationRequest.SEARCH_ALL_LAYERS);
    request.setBuffer(calculateBufferFromPixelTolerance());
View Full Code Here

   */
  @Api
  public MapWidget(String id, String applicationId) {
    setID(id);
    this.applicationId = applicationId;
    mapModel = new MapModel(getID() + "Graphics");
    mapModel.addMapModelHandler(this);
    mapModel.getMapView().addMapViewChangedHandler(this);
    graphics = new GraphicsWidget(getID() + "Graphics");
    painterVisitor = new PainterVisitor(graphics);
    mapModel.addFeatureSelectionHandler(new MapWidgetFeatureSelectionHandler(this));
View Full Code Here

public class CommitActivity implements Activity {

  public WorkflowContext execute(WorkflowContext context) throws WorkflowException {
    if (context instanceof MapModelWorkflowContext) {
      MapModelWorkflowContext mmc = (MapModelWorkflowContext) context;
      final MapModel mapModel = mmc.getMapModel();
      final FeatureTransaction ft = mmc.getFeatureTransaction();

      PersistTransactionRequest request = new PersistTransactionRequest();
      request.setFeatureTransaction(ft.toDto());
      request.setCrs(mapModel.getCrs());

      GwtCommand command = new GwtCommand(PersistTransactionRequest.COMMAND);
      command.setCommandRequest(request);

      GwtCommandDispatcher.getInstance().execute(command, new CommandCallback() {

        public void execute(CommandResponse response) {
          if (response instanceof PersistTransactionResponse) {
            PersistTransactionResponse ptr = (PersistTransactionResponse) response;
            mapModel.applyFeatureTransaction(new FeatureTransaction(ft.getLayer(), ptr
                .getFeatureTransaction()));
          }
        }
      });
    }
View Full Code Here

  private int filterCount;
  private VectorLayer vLayer;

  @Before
  public void setUp() {
    mapModel = new MapModel("test");
    vLayerInfo = new ClientVectorLayerInfo();
    VectorLayerInfo serverInfo = new VectorLayerInfo();
    serverInfo.setLayerType(LayerType.POLYGON);
    vLayerInfo.setLayerInfo(serverInfo);
    vLayerInfo.setMaxExtent(new Bbox(0, 0, 180, 180));
View Full Code Here

    return "org.geomajas.gwt.client.widget.attribute.AttributeFormTest";
  }

  @PostConstruct
  public void initialize() {
    mapModel = new MapModel("mapBeans");
    mapModel.initialize(mapInfo);
    layer = mapModel.getVectorLayer("beansLayer");
  }
View Full Code Here

public class TestSequenceProcessor {

  private MapModel mapModel;

  public TestSequenceProcessor() {
    mapModel = new MapModel("foobar");
    ClientMapInfo info = new ClientMapInfo();
    info.setCrs("EPSG:4326");
    info.setInitialBounds(new Bbox(0, 0, 180, 180));

    ClientVectorLayerInfo layerInfo = new ClientVectorLayerInfo();
View Full Code Here

TOP

Related Classes of org.geomajas.gwt.client.map.MapModel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.