本文整理汇总了Java中com.google.gwt.maps.client.overlay.Marker类的典型用法代码示例。如果您正苦于以下问题:Java Marker类的具体用法?Java Marker怎么用?Java Marker使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Marker类属于com.google.gwt.maps.client.overlay包,在下文中一共展示了Marker类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: updateMarkerFromState
import com.google.gwt.maps.client.overlay.Marker; //导入依赖的package包/类
private void updateMarkerFromState(Marker m, GWTMarkerState marker) {
m.setImage(marker.getImageURL());
m.setVisible(marker.isVisible());
}
开发者ID:qoswork,项目名称:opennmszh,代码行数:5,代码来源:GoogleMapsPanel.java
示例17: drawStacksOntoMapAsIcons
import com.google.gwt.maps.client.overlay.Marker; //导入依赖的package包/类
/**
* draws the current list of stack onto the map currently displayed.
*/
protected void drawStacksOntoMapAsIcons()
{
Iterator stacks = _stacks.iterator();
while (stacks.hasNext())
{
final BikeStack aStack = (BikeStack)stacks.next();
MarkerOptions options;
if (_displayStacksAs == DISPLAY_STACKS_AS_ICONS)
{
options = MarkerOptions.newInstance(_bingleTypeManager.getIconById(aStack.getType(),true));
}
else if (_displayStacksAs == DISPLAY_STACKS_AS_LARGE_ICONS)
{
options = MarkerOptions.newInstance(_bingleTypeManager.getIconById(aStack.getType(),false));
}
else
{
options = MarkerOptions.newInstance();
}
options.setClickable(true);
options.setDraggable(false);
final Marker aStackMarker = new Marker(aStack.getPosition(),options);
MarkerClickHandler myMarkerClickHandler = new MarkerClickHandler() {
public void onClick(MarkerClickEvent event)
{
InfoWindow info = _map.getInfoWindow();
BikeStackInfoWindowContent cont = new BikeStackInfoWindowContent(aStack,_bingleTypeManager);
InfoWindowContent content = new InfoWindowContent(cont);
info.open(aStackMarker.getLatLng(),content);
}
};
aStackMarker.addMarkerClickHandler(myMarkerClickHandler);
_map.addOverlay(aStackMarker);
if (aStack.getId() == _popupStackId &&
_modeSetting == MODE_SETTING_VIEW &&
_displaySetting == DISPLAY_SETTING_ICONS)
{
myMarkerClickHandler.onClick(null);
panTo(aStack.getPosition());
GWT.log("showing", null);
_popupStackId = -1;
}
}
}
开发者ID:lachlanhurst,项目名称:BikeBingle,代码行数:53,代码来源:MapManager.java
示例18: showProperty
import com.google.gwt.maps.client.overlay.Marker; //导入依赖的package包/类
@Override
public void showProperty(PropertiesDTO property, Users user) {
this.property = property;
pid.setHTML(PROPERTY_NUM + property.getId());
String pType = property.getPType() == 0 ? PropertyOptions.UNKNOWN_PROP : PropertyOptions.P_TYPES.get(property
.getPType() - 1);
String pMode = property.getPMode().intValue() == 1 ? PropertyOptions.forSale : PropertyOptions.rent;
String topDescStr = " " + PropertyOptions.getFormattedPTypeNMode(pType, pMode)
+ " - <span style=\"color:#516C72\"> " + property.getTitle() + "</span>";
setWindowTitle(PropertyOptions.getFormattedPTypeNMode(pType, pMode) + " " + property.getTitle()
+ " - Gharonda.com");
topDesc.setHTML(topDescStr);
String priceStr = PropertyOptions.getFormattedPrice(property.getPrice(), property.getCurrency());
price.setHTML(priceStr);
String bedRooms = property.getBedRooms() == 0 ? "0" : PropertyOptions.BEDROOM_TYPES
.get(property.getBedRooms() - 1);
String bathRooms = property.getBathRooms().toString();
String sft = property.getSqrft().toString();
String roomsStr = bedRooms + ", " + bathRooms + " " + BATH + ", " + sft + SQ_FT;
rooms.setHTML(roomsStr);
String addrLine1 = PropertyOptions.getFormattedAddrLine(property.getStreetName(), property.getAddrNum(), null,
" No:");
address1.setHTML(addrLine1);
String addrLine2 = PropertyOptions.getFormattedAddrLine(property.getSuburb(), property.getCity(),
property.getState(), " ");
address2.setHTML(addrLine2);
String selHeat = property.getHeat() == 0 ? PropertyOptions.NOT_GIVEN : PropertyOptions.HEAT_TYPES.get(property
.getHeat() - 1);
heat.setHTML(selHeat);
String selView = property.getView() == 0 ? PropertyOptions.NOT_GIVEN : PropertyOptions.VIEW_TYPES.get(property
.getView() - 1);
view.setHTML(selView);
buildDate.setHTML(property.getBuildDate());
String selHomeLoan = property.getHomeLoan() == 0 ? PropertyOptions.NOT_GIVEN : PropertyOptions.YES_NO_OPTIONS
.get(property.getHomeLoan() - 1);
homeLoan.setHTML(selHomeLoan);
String selFloor = property.getFloor() == 0 ? PropertyOptions.NOT_GIVEN : PropertyOptions.FLOORS_TYPES
.get(property.getFloor() - 1);
floor.setHTML(selFloor);
String pricePerSfStr = PropertyOptions.UNKNOWN + " ";
if (property.getSqrft() > 0) {
Integer p = (property.getPrice() / property.getSqrft());
pricePerSfStr = p.toString();
}
priceperSft.setHTML(pricePerSfStr);
created.setHTML(PropertyOptions.getFormattedDate(property.getCreated()));
modified.setHTML(PropertyOptions.getFormattedDate(property.getTimeStamp()));
name.setHTML(user.getFirstName() + " " + user.getLastName());
phone.setHTML(user.getPhone());
cell.setHTML(user.getCell());
if (user.getServiceproviderdetails() != null) {
companyName.setHTML(user.getServiceproviderdetails().getCompanyName());
}
map.clearOverlays();
LatLng center = LatLng.newInstance(property.getLat().doubleValue(), property.getLng().doubleValue());
map.setCenter(center);
Marker m = new Marker(center);
map.addOverlay(m);
}
开发者ID:jchaganti,项目名称:gharonda,代码行数:82,代码来源:PropertyDetailsWithMapView.java
示例19: showResults
import com.google.gwt.maps.client.overlay.Marker; //导入依赖的package包/类
private void showResults(Integer category) {
List<Marker> markers = categoryToMarkers.get(category);
for (Marker m : markers) {
m.setVisible(true);
}
}
开发者ID:jchaganti,项目名称:gharonda,代码行数:7,代码来源:PropertyDetailsWithMapView.java
注:本文中的com.google.gwt.maps.client.overlay.Marker类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论