当前位置: 首页>>代码示例>>Java>>正文


Java Marker类代码示例

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


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

示例1: createNativePin

import com.google.gwt.maps.client.overlay.Marker; //导入依赖的package包/类
@Override
protected Marker createNativePin(Pin pin) {
	final MarkerOptions options = MarkerOptions.newInstance();
		
	if(pin.getTitle() != null) {
		options.setTitle(pin.getTitle());
	}
	
	options.setDraggable(pin.isDraggable());

	if(pin.getImageURL() != null) {
		final Icon icon = Icon.newInstance(pin.getImageURL());
		icon.setIconSize(Size.newInstance(pin.getImageWidth(), pin.getImageHeight()));
		icon.setIconAnchor(Point.newInstance(
			// Horizontal center
			pin.getImageWidth() / 2,
			// Bottom
			pin.getImageHeight()));
		options.setIcon(icon);
	}
	
	return new Marker(
		LatLng.newInstance(pin.getLatitude(), pin.getLongitude()), 
		options);
}
 
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:26,代码来源:GoogleWorldMap.java

示例2: showLocationDetails

import com.google.gwt.maps.client.overlay.Marker; //导入依赖的package包/类
/** {@inheritDoc} */
public void showLocationDetails(final String name, final String htmlTitle, final String htmlContent) {
    final Marker m = m_markers.get(name);

    getMapWidget().savePosition();
    getMapWidget().setCenter(m.getLatLng());
    if (m != null) {
        final VerticalPanel panel = new VerticalPanel();
        panel.add(new Label(htmlTitle));
        panel.add(new HTML(htmlContent));
        getMapWidget().getInfoWindow().open(m.getLatLng(), new InfoWindowContent(panel.toString()));
        getMapWidget().getInfoWindow().addInfoWindowCloseClickHandler(new InfoWindowCloseClickHandler() {
            public void onCloseClick(InfoWindowCloseClickEvent event) {
                getMapWidget().returnToSavedPosition();
            }
        });
    }
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:19,代码来源:GoogleMapsPanel.java

示例3: createMarker

import com.google.gwt.maps.client.overlay.Marker; //导入依赖的package包/类
private Marker createMarker(final GWTMarkerState marker) {
    final Icon icon = Icon.newInstance();
    icon.setIconSize(Size.newInstance(32, 32));
    icon.setIconAnchor(Point.newInstance(16, 32));
    String markerImageURL = marker.getImageURL();
    icon.setImageURL(markerImageURL);
    
    final MarkerOptions markerOptions = MarkerOptions.newInstance();
    markerOptions.setAutoPan(true);
    markerOptions.setClickable(true);
    markerOptions.setTitle(marker.getName());
    markerOptions.setIcon(icon);

    Marker m = new Marker(toLatLng(marker.getLatLng()), markerOptions);
    m.setVisible(marker.isVisible());
    m.addMarkerClickHandler(new DefaultMarkerClickHandler(marker));
    return m;
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:19,代码来源:GoogleMapsPanel.java

示例4: showPointSelection

import com.google.gwt.maps.client.overlay.Marker; //导入依赖的package包/类
public void showPointSelection(LatLng pt)
{
	MarkerOptions mo = MarkerOptions.newInstance(_pointSelectionIcon);
	final Marker m = new Marker(pt,mo);
	
	mo.setClickable(true);
	mo.setDraggable(false);
	
	_map.addOverlay(m);
	
	Timer t = new Timer(){
		public void run() {
			_map.removeOverlay(m);
		}
	};
	t.schedule(4000);
}
 
开发者ID:lachlanhurst,项目名称:BikeBingle,代码行数:18,代码来源:MapManager.java

示例5: onClick

import com.google.gwt.maps.client.overlay.Marker; //导入依赖的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

示例6: displayResults

import com.google.gwt.maps.client.overlay.Marker; //导入依赖的package包/类
private void displayResults(List<Neightbourhood> neighbourhoodList) {

		for (Neightbourhood n : neighbourhoodList) {

			Marker m = new Marker(LatLng.newInstance(n.getLat().doubleValue(), n.getLng().doubleValue()),
					categoryToMarkerOptions.get(n.getCategory()));

			// m.setImage(categoryToIconsMap.get(n.getCategory()));
			// m.setImage("images/benzin_istasyonu.png");

			List<Marker> overlayList = null;// categoryToMarkers.get(n.getCategory
			// ());
			if (!categoryToMarkers.containsKey(n.getCategory())) {
				overlayList = new ArrayList<Marker>();
				categoryToMarkers.put(n.getCategory(), overlayList);

			} else {
				overlayList = categoryToMarkers.get(n.getCategory());
			}

			overlayList.add(m);
			map.addOverlay(m);
		}

	}
 
开发者ID:jchaganti,项目名称:gharonda,代码行数:26,代码来源:PropertyDetailsWithMapView.java

示例7: addPinDragEndHandler

import com.google.gwt.maps.client.overlay.Marker; //导入依赖的package包/类
@Override
protected void addPinDragEndHandler(Marker pin, final PinDragEndHandler dragEndHandler) {
	pin.addMarkerDragEndHandler(new MarkerDragEndHandler() {

		@Override
		public void onDragEnd(MarkerDragEndHandler.MarkerDragEndEvent event) {
			final LatLng latLng = event.getSender().getLatLng();
			dragEndHandler.onDragEnd(latLng.getLatitude(), latLng.getLongitude());
		}
	});
}
 
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:12,代码来源:GoogleWorldMap.java

示例8: displayPins

import com.google.gwt.maps.client.overlay.Marker; //导入依赖的package包/类
@Override
protected void displayPins(List<Marker> markers) {
	map.clearOverlays();
	for(final Marker marker : markers) {
		map.addOverlay(marker);
	}
}
 
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:8,代码来源:GoogleWorldMap.java

示例9: placeMarker

import com.google.gwt.maps.client.overlay.Marker; //导入依赖的package包/类
/** {@inheritDoc} */
public void placeMarker(final GWTMarkerState marker) {
	m_markerStates.put(marker.getName(), marker);

	Marker m = m_markers.get(marker.getName());
    if (m == null) {
    	m = createMarker(marker);
    	m_markers.put(marker.getName(), m);
    	addOverlay(m);
    }
	updateMarkerFromState(m, marker);
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:13,代码来源:GoogleMapsPanel.java

示例10: drawPickedPointOntoMap

import com.google.gwt.maps.client.overlay.Marker; //导入依赖的package包/类
protected void drawPickedPointOntoMap()
{
	if (_pickedPoint != null)
	{
		MarkerOptions options = MarkerOptions.newInstance();
		//options.setClickable(true);
		options.setDraggable(false);
		
		Marker aStackMarker = new Marker(_pickedPoint,options);
		_map.addOverlay(aStackMarker);
		_map.panTo(_pickedPoint);
	}
}
 
开发者ID:lachlanhurst,项目名称:BikeBingle,代码行数:14,代码来源:MapManager.java

示例11: setMarker

import com.google.gwt.maps.client.overlay.Marker; //导入依赖的package包/类
private void setMarker(LatLng point) {
	MarkerOptions options = MarkerOptions.newInstance();
	options.setDraggable(true);
	marker = new Marker(point, options);
	marker.setDraggingEnabled(true);
	map.addOverlay(marker);
}
 
开发者ID:jchaganti,项目名称:gharonda,代码行数:8,代码来源:ModifyPropertyView.java

示例12: hideResults

import com.google.gwt.maps.client.overlay.Marker; //导入依赖的package包/类
private void hideResults(Integer category) {
	List<Marker> markers = categoryToMarkers.get(category);
	for (Marker m : markers) {
		m.setVisible(false);
	}

}
 
开发者ID:jchaganti,项目名称:gharonda,代码行数:8,代码来源:PropertyDetailsWithMapView.java

示例13: onMouseOver

import com.google.gwt.maps.client.overlay.Marker; //导入依赖的package包/类
@Override
public void onMouseOver(MarkerMouseOverEvent event) {

	Marker m = ((Marker) event.getSource());
	m.setImage("images/map_icon_red_35x22.gif");
	PropertiesDTO p = propertiesGrid.getRowValue(overLayToRowIndex.get(m));
	InfoWindow w = map.getInfoWindow();
	w.setMaximizeEnabled(true);
	HTML h = new HTML(getPropertyHTML(p));
	w.open(m.getLatLng(), new InfoWindowContent(h));

}
 
开发者ID:jchaganti,项目名称:gharonda,代码行数:13,代码来源:ResultWithMapView.java

示例14: movePin

import com.google.gwt.maps.client.overlay.Marker; //导入依赖的package包/类
@Override
protected void movePin(Marker marker, double latitude, double longitude) {
	marker.setLatLng(LatLng.newInstance(latitude, longitude));
}
 
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:5,代码来源:GoogleWorldMap.java

示例15: addOverlay

import com.google.gwt.maps.client.overlay.Marker; //导入依赖的package包/类
private void addOverlay(final Marker newMarker) {
    getMapWidget().addOverlay(newMarker);
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:4,代码来源:GoogleMapsPanel.java


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