• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java MapWidget类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.google.gwt.maps.client.MapWidget的典型用法代码示例。如果您正苦于以下问题:Java MapWidget类的具体用法?Java MapWidget怎么用?Java MapWidget使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



MapWidget类属于com.google.gwt.maps.client包,在下文中一共展示了MapWidget类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: init

import com.google.gwt.maps.client.MapWidget; //导入依赖的package包/类
@Override
protected void init() {
	MapApiLoader.load(new AsyncCallback<Void>() {

		@Override
		public void onFailure(Throwable caught) {
			getRoot().add(new Label(I18N.CONSTANTS.connectionProblem()));
			setInitialized(true);
		}

		@Override
		public void onSuccess(Void result) {
			if(Maps.isLoaded()) {
				map = new MapWidget();
				map.setHeight("100%");
				getRoot().add(map);

				setInitialized(true);
				
			} else {
				N10N.errorNotif(I18N.CONSTANTS.googleMaps(), I18N.CONSTANTS.cannotLoadMap());
			}
		}
	});
}
 
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:26,代码来源:GoogleWorldMap.java


示例2: onClick

import com.google.gwt.maps.client.MapWidget; //导入依赖的package包/类
public void onClick(MapClickEvent e) 
{
	MapWidget sender = e.getSender();
       Overlay overlay = e.getOverlay();
       LatLng point = e.getLatLng();

       sender.clearOverlays();
       
       MarkerOptions options = MarkerOptions.newInstance();
       options.setDraggable(false);
       Marker m = new Marker(point,options);
       sender.addOverlay(m);
       _mapManager.setPickedLocation(point);
       /*if (overlay != null && overlay instanceof Marker) 
       {
         sender.removeOverlay(overlay);
       } else {
         sender.addOverlay(new Marker(point));
       }*/

}
 
开发者ID:lachlanhurst,项目名称:BikeBingle,代码行数:22,代码来源:MapClickHandlerPickLocation.java


示例3: drawOnMap

import com.google.gwt.maps.client.MapWidget; //导入依赖的package包/类
/**
 * draws the representation of this quad tree onto the given map using
 * overlays.
 * @param map
 */
public void drawOnMap(MapWidget map)
{
	Iterator leaves = _leafNodes.iterator();
	while (leaves.hasNext())
	{
		QuadTreeNode leafNode = (QuadTreeNode)leaves.next(); 
		LatLng[] pts = getBoundsAsPoints(leafNode.getBounds());
		//GWT.log(leafNode.getBounds().toString(), null);
		
		String colour = ColourMap.getColour(leafNode.getStacks().size(), _maxEntriesInAnyNode);
		
		Polygon poly = new Polygon(pts,"#ff0000",0,0.7,colour,0.4);

		//Polyline poly = new Polyline(pts,"#ff0000",3,0.7);
		//PolyStyleOptions pso = PolyStyleOptions.newInstance("#ff0000",3, 0.7);
		//poly.setStrokeStyle(pso);
		map.addOverlay(poly);
	}
}
 
开发者ID:lachlanhurst,项目名称:BikeBingle,代码行数:25,代码来源:QuadTreeManager.java


示例4: createMap

import com.google.gwt.maps.client.MapWidget; //导入依赖的package包/类
private MapWidget createMap() {
    final LatLng tsu = LatLng.newInstance(53.5, 49.4);

    MapOptions mapOptions = MapOptions.newInstance();
    mapOptions.setCenter(tsu);
    mapOptions.setZoom(13);
    mapOptions.setScrollWheel(true);
    mapOptions.setZoomControl(true);
    final MapWidget map = new MapWidget(mapOptions);
    //map.setContinuousZoom(true);
    //map.setScrollWheelZoomEnabled(true);
    map.setStylePrimaryName("map");

    //map.addControl(new LargeMapControl());

    //map.addControl(new HierarchicalMapTypeControl());

    return map;
}
 
开发者ID:halls,项目名称:wannatrak,代码行数:20,代码来源:MainWidget.java


示例5: initMap

import com.google.gwt.maps.client.MapWidget; //导入依赖的package包/类
protected void initMap() {
    getWidget().initMap(getState().center, getState().zoom,
        getState().mapTypeId);
    getWidget().setMarkerClickListener(this);
    getWidget().setMapMoveListener(this);
    getWidget().setMapClickListener(this);
    getWidget().setMarkerDragListener(this);
    getWidget().setInfoWindowClosedListener(this);
    getWidget().setMapTypeChangeListener(this);
    getLayoutManager().addElementResizeListener(getWidget().getElement(),
        new ElementResizeListener() {
            @Override
            public void onElementResize(ElementResizeEvent e) {
                getWidget().triggerResize();
            }
        });
    MapWidget map = getWidget().getMap();
    updateFromState(true);
    for (GoogleMapInitListener listener : initListeners) {
        listener.mapWidgetInitiated(map);
    }
}
 
开发者ID:tapioaali,项目名称:GoogleMapsVaadin7,代码行数:23,代码来源:GoogleMapConnector.java


示例6: loadMap

import com.google.gwt.maps.client.MapWidget; //导入依赖的package包/类
/**
 * Once the API has been loaded, the MapWidget can be initialized. This
 * method will initialize the MapWidget and place it inside the wrapper from
 * the composite root.
 */
private void loadMap() {
    mapOpt = MapOptions.newInstance();

    map = new MapWidget(mapOpt);
    wrapperPanel.add(map);

    map.addDragEndHandler(dragEndMapHandler);
    map.addClickHandler(clickMapHanler);
    map.addIdleHandler(idleMapHandler);

    // This method call of the Paintable interface sets the component
    // style name in DOM tree
    setStyleName(CLASSNAME);

    // Update all the uidl requests that have been made
    if (stack != null) {
        for(UIDL uidl : stack) {
            updateFromUIDL(uidl, client);
        }
    }
    stack = null;
}
 
开发者ID:wilds,项目名称:GoogleMapWidgetV3,代码行数:28,代码来源:VGoogleMap.java


示例7: createMarker

import com.google.gwt.maps.client.MapWidget; //导入依赖的package包/类
Marker createMarker(final MapWidget mapWidget, LatLng location, String iconFile) {
    MarkerOptions options = MarkerOptions.newInstance();
    options.setPosition(location);
    final MarkerImage markerImage = MarkerImage.newInstance(iconFile);
    options.setIcon(markerImage);
    final Marker marker = Marker.newInstance(options);
    marker.setMap(mapWidget);

    return marker;
}
 
开发者ID:baldram,项目名称:tristar-eye,代码行数:11,代码来源:GMapManager.java


示例8: addMarkers

import com.google.gwt.maps.client.MapWidget; //导入依赖的package包/类
void addMarkers(final MapWidget mapWidget, List<TrafficOccurrenceDto> trafficOccurrences) {
    // TODO: remove existing before add
    for (TrafficOccurrenceDto occurrence : trafficOccurrences) {
        Coordinates coordinates = wktUtil.getPointAsPair(occurrence.getLocation());
        if (coordinates != null) {
            addMarker(mapWidget, occurrence, coordinates);
        }
    }
}
 
开发者ID:baldram,项目名称:tristar-eye,代码行数:10,代码来源:TrafficOccurrencesManager.java


示例9: addMarker

import com.google.gwt.maps.client.MapWidget; //导入依赖的package包/类
private void addMarker(MapWidget mapWidget, TrafficOccurrenceDto occurrence, Coordinates coordinates) {
    Coordinates latLngCoordinates = wktUtil.toLatitudeLongitude(coordinates);
    String cameraIconFile = getTrafficOccurrenceIcon(Integer.valueOf(occurrence.getIconType()));
    Marker marker = mapManager.createMarker(mapWidget, LatLng.newInstance(latLngCoordinates.getX(), latLngCoordinates.getY()), cameraIconFile);
    marker.setTitle(occurrence.getEventName());
    if (occurrence.getEventName() != null) {
        addOccurrenceClickHandler(occurrence, marker);
    }
}
 
开发者ID:baldram,项目名称:tristar-eye,代码行数:10,代码来源:TrafficOccurrencesManager.java


示例10: MapManager

import com.google.gwt.maps.client.MapWidget; //导入依赖的package包/类
public MapManager(MapWidget map, BikeStackTypes bingleTypeManager, int initialPopupId)
{
	_popupStackId = initialPopupId;
	_stacks = new ArrayList();
	_bingleTypeManager = bingleTypeManager;
	_map = map;
	_bounds = _map.getBounds();
	_boundsEnlarged = LatLngBounds.newInstance(); //getBoundsEnalarged(_bounds);
	
	_binglesComm = new BinglesCommunicationManager();
	_binglesComm.addBinglesReturnedListener(new BinglesCommunicationManager.BinglesReturnedListener(){

		public void onBinglesReturned(List bingles) 
		{
			_stacks.clear();
			_stacks.addAll(bingles);
			drawStacksOntoMap();
		}
		
	});
	
	_pointSelectionIcon = Icon.newInstance("selectionRing.png");
	Point anc = Point.newInstance(20, 20);
	_pointSelectionIcon.setIconAnchor(anc);
	
	_locationPicker = new MapClickHandlerPickLocation(this);
}
 
开发者ID:lachlanhurst,项目名称:BikeBingle,代码行数:28,代码来源:MapManager.java


示例11: MapController

import com.google.gwt.maps.client.MapWidget; //导入依赖的package包/类
public MapController(Mediator mediator, MapWidget mapWidget) {
    this.mediator = mediator;
    this.mapWidget = mapWidget;

    options = KmlLayerOptions.newInstance();
    options.setPreserveViewport(true);

    layers = new HashMap<Long, KmlLayer>();
}
 
开发者ID:halls,项目名称:wannatrak,代码行数:10,代码来源:MapController.java


示例12: hideCameras

import com.google.gwt.maps.client.MapWidget; //导入依赖的package包/类
@Override
public void hideCameras() {
	for (Marker marker: cameraMarkers) {
		marker.setMap((MapWidget)null);
	}
	
	localStorage.setItem("KEY_SHOW_CAMERAS", "false");
}
 
开发者ID:WSDOT,项目名称:wsdot-mobile-app,代码行数:9,代码来源:TrafficMapViewGwtImpl.java


示例13: hideRestAreas

import com.google.gwt.maps.client.MapWidget; //导入依赖的package包/类
@Override
public void hideRestAreas() {
    for (Marker marker: restAreaMarkers) {
        marker.setMap((MapWidget)null);
    }

    localStorage.setItem("KEY_SHOW_RESTAREAS", "false");
}
 
开发者ID:WSDOT,项目名称:wsdot-mobile-app,代码行数:9,代码来源:TrafficMapViewGwtImpl.java


示例14: deleteCameras

import com.google.gwt.maps.client.MapWidget; //导入依赖的package包/类
@Override
public void deleteCameras() {
	for (Marker marker: cameraMarkers) {
		marker.setMap((MapWidget)null);
	}
	
	cameraMarkers.clear();
}
 
开发者ID:WSDOT,项目名称:wsdot-mobile-app,代码行数:9,代码来源:TrafficMapViewGwtImpl.java


示例15: addMapMarker

import com.google.gwt.maps.client.MapWidget; //导入依赖的package包/类
@Override
public void addMapMarker(Position position) {

	if (myLocationMarker != null) {
           myLocationMarker.setMap((MapWidget) null);
       }

       if (myLocationError != null){
           myLocationError.setMap(null);
	}

       LatLng center = LatLng.newInstance(position.getCoordinates().getLatitude(), position.getCoordinates().getLongitude());
	MarkerOptions options = MarkerOptions.newInstance();
	options.setPosition(center);
	MarkerImage icon = MarkerImage.newInstance(AppBundle.INSTANCE.myLocationPNG().getSafeUri().asString());
       icon.setAnchor(Point.newInstance(11, 11));
       options.setOptimized(true);
	options.setIcon(icon);
	myLocationMarker = Marker.newInstance(options);
	myLocationMarker.setMap(mapWidget);

       // create a circle the size of the error
       CircleOptions circleOptions = CircleOptions.newInstance();
       circleOptions.setFillOpacity(0.1);
       circleOptions.setFillColor("#1a75ff");
       circleOptions.setStrokeOpacity(0.12);
       circleOptions.setStrokeWeight(1);
       circleOptions.setStrokeColor("#1a75ff");
       myLocationError = Circle.newInstance(circleOptions);
       myLocationError.setCenter(center);
       myLocationError.setRadius(position.getCoordinates().getAccuracy());
       myLocationError.setMap(mapWidget);

}
 
开发者ID:WSDOT,项目名称:wsdot-mobile-app,代码行数:35,代码来源:TrafficMapViewGwtImpl.java


示例16: deleteAlerts

import com.google.gwt.maps.client.MapWidget; //导入依赖的package包/类
@Override
public void deleteAlerts() {
	for (Marker marker: alertMarkers) {
		marker.setMap((MapWidget)null);
	}

	alertMarkers.clear();
}
 
开发者ID:WSDOT,项目名称:wsdot-mobile-app,代码行数:9,代码来源:TrafficMapViewGwtImpl.java


示例17: deleteRestAreas

import com.google.gwt.maps.client.MapWidget; //导入依赖的package包/类
@Override
public void deleteRestAreas() {
    for (Marker marker: restAreaMarkers) {
        marker.setMap((MapWidget)null);
    }

    restAreaMarkers.clear();
}
 
开发者ID:WSDOT,项目名称:wsdot-mobile-app,代码行数:9,代码来源:TrafficMapViewGwtImpl.java


示例18: deleteCallouts

import com.google.gwt.maps.client.MapWidget; //导入依赖的package包/类
@Override
public void deleteCallouts() {
    for (Marker marker: calloutMarkers) {
        marker.setMap((MapWidget)null);
    }

    calloutMarkers.clear();
}
 
开发者ID:WSDOT,项目名称:wsdot-mobile-app,代码行数:9,代码来源:TrafficMapViewGwtImpl.java


示例19: addMapMarker

import com.google.gwt.maps.client.MapWidget; //导入依赖的package包/类
@Override
public void addMapMarker(Position position) {
	if (myLocationMarker != null) {
		myLocationMarker.setMap((MapWidget) null);
	}

	if (myLocationError != null){
		myLocationError.setMap(null);
	}

	LatLng center = LatLng.newInstance(position.getCoordinates().getLatitude(), position.getCoordinates().getLongitude());
	MarkerOptions options = MarkerOptions.newInstance();
	options.setPosition(center);
	MarkerImage icon = MarkerImage.newInstance(AppBundle.INSTANCE.myLocationPNG().getSafeUri().asString());
	icon.setAnchor(Point.newInstance(11, 11));
	options.setOptimized(true);
	options.setIcon(icon);
	myLocationMarker = Marker.newInstance(options);
	myLocationMarker.setMap(mapWidget);

	// create a circle the size of the error
	CircleOptions circleOptions = CircleOptions.newInstance();
	circleOptions.setFillOpacity(0.1);
	circleOptions.setFillColor("#1a75ff");
	circleOptions.setStrokeOpacity(0.12);
	circleOptions.setStrokeWeight(1);
	circleOptions.setStrokeColor("#1a75ff");
	myLocationError = Circle.newInstance(circleOptions);
	myLocationError.setCenter(center);
	myLocationError.setRadius(position.getCoordinates().getAccuracy());
	myLocationError.setMap(mapWidget);
}
 
开发者ID:WSDOT,项目名称:wsdot-mobile-app,代码行数:33,代码来源:VesselWatchMapViewGwtImpl.java


示例20: deleteFerries

import com.google.gwt.maps.client.MapWidget; //导入依赖的package包/类
@Override
public void deleteFerries() {
	for (Marker marker: vesselMarkers) {
		marker.setMap((MapWidget)null);
	}
	
	vesselMarkers.clear();
}
 
开发者ID:WSDOT,项目名称:wsdot-mobile-app,代码行数:9,代码来源:VesselWatchMapViewGwtImpl.java



注:本文中的com.google.gwt.maps.client.MapWidget类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Header类代码示例发布时间:2022-05-21
下一篇:
Java PayloadAttribute类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap