List of usage examples for com.google.gwt.maps.client.overlays Animation DROP
Animation DROP
To view the source code for com.google.gwt.maps.client.overlays Animation DROP.
Click Source Link
From source file:com.google.gwt.maps.testing.client.maps.BasicMapWidget.java
License:Apache License
private void draw() { Button addBounceMarkerButton = new Button("Add Marker with Bounce"); addBounceMarkerButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { if (markerBouncing != null) { markerBouncing.clear();/*from w w w . j a va 2 s . c o m*/ } drawMarkerWithBounceAnimation(); } }); Button addDropMarkerButton = new Button("Add Marker with Drop"); addDropMarkerButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { if (markerDrop != null) { markerDrop.clear(); } drawMarkerWithDropAnimation(); } }); Button stopAnimationsButton = new Button("Stop Animations"); stopAnimationsButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { if (markerBasic != null) { markerBasic.setAnimation(Animation.STOPANIMATION); } if (markerBouncing != null) { markerBouncing.setAnimation(Animation.STOPANIMATION); } if (markerDrop != null) { markerDrop.setAnimation(Animation.STOPANIMATION); } } }); Button startAnimationsButton = new Button("Start Animations"); startAnimationsButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { if (markerBasic != null) { markerBasic.setAnimation(Animation.BOUNCE); } if (markerBouncing != null) { markerBouncing.setAnimation(Animation.BOUNCE); } if (markerDrop != null) { markerDrop.setAnimation(Animation.DROP); } } }); // basic controls to test markers HorizontalPanel hp = new HorizontalPanel(); hp.add(new HTML("<br>Basic Map Example. With an AdUnit")); hp.add(addBounceMarkerButton); hp.add(new HTML(" ")); hp.add(addDropMarkerButton); hp.add(new HTML(" ")); hp.add(startAnimationsButton); hp.add(new HTML(" ")); hp.add(stopAnimationsButton); hp.setCellVerticalAlignment(addBounceMarkerButton, VerticalPanel.ALIGN_BOTTOM); hp.setCellVerticalAlignment(addDropMarkerButton, VerticalPanel.ALIGN_BOTTOM); hp.setCellVerticalAlignment(startAnimationsButton, VerticalPanel.ALIGN_BOTTOM); hp.setCellVerticalAlignment(stopAnimationsButton, VerticalPanel.ALIGN_BOTTOM); pWidget.clear(); pWidget.add(hp); drawMap(); drawMapAds(); drawBasicMarker(); }
From source file:com.google.gwt.maps.testing.client.maps.BasicMapWidget.java
License:Apache License
private void drawMarkerWithDropAnimation() { LatLng center = LatLng.newInstance(42.33, -120.81); MarkerOptions options = MarkerOptions.newInstance(); options.setPosition(center);//from ww w.j a v a2 s .c o m options.setTitle("Thanks for clicking on me."); options.setAnimation(Animation.DROP); markerDrop = Marker.newInstance(options); markerDrop.setMap(mapWidget); }