Search in sources :

Example 1 with Map

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

the class CatalogMapMoveListenerProvider method get.

@Override
public MapMoveEndListener get() {
    return new MapMoveEndListener() {

        @Override
        public void onMapMoveEnd(MapMoveEndEvent eventObject) {
            Map map = eventObject.getSource();
            fireCatalogBBoxChangeEvent(CatalogMapExtentReprojector.reprojects(new Projection(map.getProjection()), map.getExtent()));
        }
    };
}
Also used : MapMoveEndEvent(org.gwtopenmaps.openlayers.client.event.MapMoveEndListener.MapMoveEndEvent) Projection(org.gwtopenmaps.openlayers.client.Projection) MapMoveEndListener(org.gwtopenmaps.openlayers.client.event.MapMoveEndListener) Map(org.gwtopenmaps.openlayers.client.Map)

Example 2 with Map

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

the class GPFeatureInfoWidget method refreshFeatures.

@Override
public void refreshFeatures(Layer layer) {
    FeatureInfoFlyWeight.getInstance().refreshFeatures(layer);
    IGPFeatureInfoElement element = FeatureInfoFlyWeight.getInstance().get(layer);
    Map map = this.mapWidget.getMap();
    map.addControl(element.getElementControl());
    if (this.featureCaller.isActivated()) {
        element.getElementControl().activate();
    }
}
Also used : IGPFeatureInfoElement(org.geosdi.geoplatform.gui.featureinfo.cache.IGPFeatureInfoElement) Map(org.gwtopenmaps.openlayers.client.Map) GeoPlatformMap(org.geosdi.geoplatform.gui.impl.map.GeoPlatformMap)

Example 3 with Map

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

the class Utility method generateMapLiteURL.

public static String generateMapLiteURL() {
    IGPAccountDetail accountDetail = Registry.get(UserSessionEnum.ACCOUNT_DETAIL_IN_SESSION.name());
    GPClientProject clientProject = (GPClientProject) Registry.get(UserSessionEnum.CURRENT_PROJECT_ON_TREE.name());
    StringBuilder mapLiteURL = new StringBuilder();
    mapLiteURL.append(MapLiteModuleConstants.INSTANCE.MAP_LITE_APPLICATION_URL());
    mapLiteURL.append("?mapID=");
    mapLiteURL.append(clientProject.getId());
    mapLiteURL.append("-");
    mapLiteURL.append(accountDetail.getId());
    mapLiteURL.append("&x=");
    Map map = GPApplicationMap.getInstance().getApplicationMap().getMap();
    LonLat lonLat = map.getCenter();
    lonLat.transform(map.getProjection(), GPCoordinateReferenceSystem.WGS_84.getCode());
    mapLiteURL.append(lonLat.lon());
    mapLiteURL.append("&y=");
    mapLiteURL.append(lonLat.lat());
    mapLiteURL.append("&zoom=");
    mapLiteURL.append(map.getZoom());
    mapLiteURL.append("&baseMap=");
    mapLiteURL.append(accountDetail.getBaseLayer());
    return mapLiteURL.toString();
}
Also used : IGPAccountDetail(org.geosdi.geoplatform.gui.global.security.IGPAccountDetail) GPClientProject(org.geosdi.geoplatform.gui.client.model.projects.GPClientProject) LonLat(org.gwtopenmaps.openlayers.client.LonLat) Map(org.gwtopenmaps.openlayers.client.Map) GPApplicationMap(org.geosdi.geoplatform.gui.factory.map.GPApplicationMap)

Example 4 with Map

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

the class GPFeatureInfoWidget method removeLayer.

@Override
public void removeLayer(Layer layer) {
    if (FeatureInfoFlyWeight.getInstance().contains(layer)) {
        Map map = this.mapWidget.getMap();
        IGPFeatureInfoElement featureInfoElement = FeatureInfoFlyWeight.getInstance().get(layer);
        featureInfoElement.getElementControl().deactivate();
        map.removeControl(featureInfoElement.getElementControl());
        FeatureInfoFlyWeight.getInstance().remove(layer);
    }
}
Also used : IGPFeatureInfoElement(org.geosdi.geoplatform.gui.featureinfo.cache.IGPFeatureInfoElement) Map(org.gwtopenmaps.openlayers.client.Map) GeoPlatformMap(org.geosdi.geoplatform.gui.impl.map.GeoPlatformMap)

Example 5 with Map

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

the class GPFeatureInfoWidget method addLayer.

@Override
public void addLayer(Layer layer) {
    if (!FeatureInfoFlyWeight.getInstance().contains(layer)) {
        IGPFeatureInfoElement element = FeatureInfoFlyWeight.getInstance().get(layer);
        Map map = this.mapWidget.getMap();
        map.addControl(element.getElementControl());
        if (this.featureCaller.isActivated()) {
            element.getElementControl().activate();
        }
    }
}
Also used : IGPFeatureInfoElement(org.geosdi.geoplatform.gui.featureinfo.cache.IGPFeatureInfoElement) Map(org.gwtopenmaps.openlayers.client.Map) GeoPlatformMap(org.geosdi.geoplatform.gui.impl.map.GeoPlatformMap)

Aggregations

Map (org.gwtopenmaps.openlayers.client.Map)5 IGPFeatureInfoElement (org.geosdi.geoplatform.gui.featureinfo.cache.IGPFeatureInfoElement)3 GeoPlatformMap (org.geosdi.geoplatform.gui.impl.map.GeoPlatformMap)3 GPClientProject (org.geosdi.geoplatform.gui.client.model.projects.GPClientProject)1 GPApplicationMap (org.geosdi.geoplatform.gui.factory.map.GPApplicationMap)1 IGPAccountDetail (org.geosdi.geoplatform.gui.global.security.IGPAccountDetail)1 LonLat (org.gwtopenmaps.openlayers.client.LonLat)1 Projection (org.gwtopenmaps.openlayers.client.Projection)1 MapMoveEndListener (org.gwtopenmaps.openlayers.client.event.MapMoveEndListener)1 MapMoveEndEvent (org.gwtopenmaps.openlayers.client.event.MapMoveEndListener.MapMoveEndEvent)1