本文整理汇总了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);
}
示例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();
}
});
}
}
示例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;
}
示例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);
}
示例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));
}*/
}
示例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);
}
}
示例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());
}
});
}
示例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);
}
}
示例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);
}
示例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);
}
}
示例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);
}
示例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);
}
}
示例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));
}
示例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));
}
示例15: addOverlay
import com.google.gwt.maps.client.overlay.Marker; //导入依赖的package包/类
private void addOverlay(final Marker newMarker) {
getMapWidget().addOverlay(newMarker);
}