私は持っている
public class MyItemsOverlay extends ItemizedOverlay<OverlayItem>{
private List<OverlayItem> items=new ArrayList<OverlayItem>();
private Drawable marker=null;
private StatusData data;
private MapView mapView;
private PopupPanel panel;
public MyItemsOverlay (Drawable defaultMarker, View view, LayoutInflater getLayoutInflater) {
super(defaultMarker);
this.marker=defaultMarker;
mapView=(MapView) view.findViewById(R.id.mapview);
panel=new PopupPanel(R.layout.details_popup,getLayoutInflater, mapView);
data=new StatusData (mapView.getContext());
items= protectedZoneData.GetItems();
populate();
}
@Override
protected OverlayItem createItem(int i) {
return(items.get(i));
}
@Override
public int size() {
return(items.size());
}
@Override
protected boolean onTap(int i) {
OverlayItem item=getItem(i);
GeoPoint geo=item.getPoint();
View view=panel.getView();
((TextView)view.findViewById(R.id.latitude))
.setText(String.valueOf(geo.getLatitudeE6()/1000000.0));
((TextView)view.findViewById(R.id.longitude))
.setText(String.valueOf(geo.getLongitudeE6()/1000000.0));
((TextView)view.findViewById(R.id.Name))
.setText(item.getTitle());
((TextView)view.findViewById(R.id.Description))
.setText(item.getSnippet());
panel.show();
hidePopup();
return(true);
}
}
約100,000ポイントをロードする必要があります。
そして、ポリゴン (100 000 ポリゴン) を作成する別のオーバーレイがあります。
public class MyPolygonOverlay extends Overlay{
private StatusData data;
private Projection projection;
ArrayList<ArrayList<GeoPoint>> geArrayList;
public MyPolygonOverlay(Context context, MapView mapView)
{
data=new StatusData(context);
projection=mapView.getProjection();
geArrayList=data.GetPoyigonGeoPoints();
}
public void draw(Canvas canvas, MapView mapView, boolean shadow){
super.draw(canvas, mapView, shadow);
for (int i = 0; i < geArrayList.size(); i++) {
Path path = new Path();
ArrayList<GeoPoint> geoPoints=geArrayList.get(i);
for (int j = 0; j <geoPoints.size(); j++) {
GeoPoint gP1 =geoPoints.get(j);
Point currentScreenPoint = new Point();
Projection projection = mapView.getProjection();
projection.toPixels(gP1, currentScreenPoint);
if (j == 0){
path.moveTo(currentScreenPoint.x, currentScreenPoint.y);
}
else
{
path.lineTo(currentScreenPoint.x, currentScreenPoint.y);
}
}
canvas.drawPath(path, GetPaint());
}
}
ズーム レベル 5 で最初のオーバーレイを読み込み、次にズーム 8 で 2 番目のオーバーレイを読み込みます。
アプリケーションを高速化するにはどうすればよいですか?