Sha256: e5c914bc7ee8c9fc4f09aa0e8b7ad5b903d05ffb81f9fe22d93e78bfc210fc6e

Contents?: true

Size: 1.21 KB

Versions: 32

Compression:

Stored size: 1.21 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 GoogleMapView mainView;
	private Vector<Annotation> annotations;
	
	public AnnotationsOverlay(GoogleMapView 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

32 entries across 32 versions & 1 rubygems

Version Path
rhodes-3.0.2 platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/AnnotationsOverlay.java
rhodes-3.0.2.beta.1 platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/AnnotationsOverlay.java
rhodes-3.0.1 platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/AnnotationsOverlay.java
rhodes-3.0.1.beta.8 platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/AnnotationsOverlay.java
rhodes-3.0.1.beta.7 platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/AnnotationsOverlay.java
rhodes-3.0.1.beta.6 platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/AnnotationsOverlay.java
rhodes-3.0.1.beta.5 platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/AnnotationsOverlay.java
rhodes-3.0.1.beta.4 platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/AnnotationsOverlay.java
rhodes-3.0.1.beta.3 platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/AnnotationsOverlay.java
rhodes-3.0.1.beta.2 platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/AnnotationsOverlay.java
rhodes-3.0.0 platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/AnnotationsOverlay.java
rhodes-3.0.0.beta.7 platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/AnnotationsOverlay.java
rhodes-3.0.0.beta.6 platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/AnnotationsOverlay.java
rhodes-3.0.0.beta.5 platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/AnnotationsOverlay.java
rhodes-3.0.0.beta.4 platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/AnnotationsOverlay.java
rhodes-3.0.0.beta.3 platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/AnnotationsOverlay.java
rhodes-3.0.0.beta.2 platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/AnnotationsOverlay.java
rhodes-3.0.0.beta.1 platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/AnnotationsOverlay.java
rhodes-2.4.1 platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/AnnotationsOverlay.java
rhodes-2.4.1.beta.1 platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/AnnotationsOverlay.java