Sha256: 09ce7b85bd2fb3b588f4f990317f47fb11a8e7f580993bf66084f88c7811f093
Contents?: true
Size: 1.2 KB
Versions: 40
Compression:
Stored size: 1.2 KB
Contents
package com.rhomobile.rhodes.mapview; import java.util.Vector; import android.graphics.drawable.Drawable; import com.google.android.maps.GeoPoint; import com.google.android.maps.ItemizedOverlay; import com.google.android.maps.OverlayItem; import com.rhomobile.rhodes.WebView; public class AnnotationsOverlay extends ItemizedOverlay<OverlayItem> { private MapView mainView; private Vector<Annotation> annotations; public AnnotationsOverlay(MapView view, Drawable marker) { super(boundCenterBottom(marker)); mainView = view; annotations = new Vector<Annotation>(); populate(); } public void addAnnotation(Annotation ann) { annotations.addElement(ann); populate(); } @Override protected OverlayItem createItem(int i) { Annotation ann = annotations.elementAt(i); GeoPoint pnt = new GeoPoint((int)(ann.latitude*1000000), (int)(ann.longitude*1000000)); return new OverlayItem(pnt, ann.title, ann.subtitle); } @Override public int size() { return annotations.size(); } @Override protected boolean onTap(int i) { Annotation ann = annotations.elementAt(i); if (ann.url == null) return false; WebView.navigate(ann.url, WebView.activeTab()); mainView.finish(); return true; } }
Version data entries
40 entries across 40 versions & 1 rubygems