//package com.jqyd.newprocess;
//
//import java.util.ArrayList;
//
//import android.content.Context;
//import android.graphics.Color;
//import android.graphics.drawable.Drawable;
//import android.text.Html;
//import android.view.View;
//import android.widget.ImageView;
//import android.widget.TextView;
//
//import com.amap.mapapi.core.OverlayItem;
//import com.amap.mapapi.map.ItemizedOverlay;
//import com.amap.mapapi.map.MapView;
//import com.jqyd.manager.R;
//
////在MAPVIEW之上创建一个图层,需要创建一个类,实现Overlay,并生成该类的对象,然后将该对象添加到MapView.getOverlays()
////一个OverlayItem对象代表一个在地图上显示的标记
//public class OverLay extends ItemizedOverlay<OverlayItem>{
// //创建list对象,用于持有该图层当中所有的标记对象
// private ArrayList<OverlayItem> overlayItems = new ArrayList<OverlayItem>();
// //新增
// private Wzcx1 context;
// private Gzgj context2;
// private TextView textView1,textView2;
// private int type = 0;
//
// public OverLay(Drawable marker) {
// super(boundCenterBottom(marker));
// }
//
// /**
// * type:0、wzcx1、gzgj
// * @param marker
// * @param context
// * @param type
// */
// public OverLay(Drawable marker,Context context,int type){
// super(boundCenterBottom(marker));
// if(type == 0){
// this.context = (Wzcx1) context;
// }else{
// this.context2 = (Gzgj) context;
// }
// this.type = type;
// }
// //将生成好的OverlayItem对象添加到List当中
// public void addOverlay(OverlayItem overlayItem){
// overlayItems.add(overlayItem);
// populate();
// }
// //创建一个OverlayItem对象
// @Override
// protected OverlayItem createItem(int i) {
// return overlayItems.get(i);
// }
//
// @Override
// public int size() {
// return overlayItems.size();
// }
//
// protected boolean onTap(int i) {
// if(type != 1){
// MapView.LayoutParams geoLP = (MapView.LayoutParams)context.popView.getLayoutParams();
// geoLP.point = overlayItems.get(i).getPoint();
// context.mapView.updateViewLayout(context.popView, geoLP);
// context.popView.setVisibility(View.VISIBLE);
// textView1 = (TextView) context.popView.findViewById(R.id.map_bubbleTitle);
// textView2 = (TextView) context.popView.findViewById(R.id.map_bubbleText);
// //textView1.setText(overlayItems.get(i).getTitle());
// String contents[] = overlayItems.get(i).getSnippet().split("#");
//
// textView1.setText(contents[0]);
// textView1.setTextColor(Color.RED);
// textView2.setText(Html.fromHtml(contents[1]));
// textView2.setTextColor(Color.BLUE);
// context.popView.setVisibility(View.VISIBLE);
// ImageView imageView = (ImageView) context.popView.findViewById(R.id.map_bubbleImage);
// imageView.setOnClickListener(new View.OnClickListener(){
//
// public void onClick(View v) {
// context.popView.setVisibility(View.GONE);
// }
//
// });
// }else{
// MapView.LayoutParams geoLP = (MapView.LayoutParams)context2.popView.getLayoutParams();
// geoLP.point = overlayItems.get(i).getPoint();
// context2.mMapView.updateViewLayout(context2.popView, geoLP);
// context2.popView.setVisibility(View.VISIBLE);
// textView1 = (TextView) context2.popView.findViewById(R.id.map_bubbleTitle);
// textView2 = (TextView) context2.popView.findViewById(R.id.map_bubbleText);
//
// textView1.setText("定位详情");
// textView1.setTextColor(Color.RED);
// textView2.setText(Html.fromHtml(overlayItems.get(i).getSnippet()));
// textView2.setTextColor(Color.BLUE);
// context2.popView.setVisibility(View.VISIBLE);
// ImageView imageView = (ImageView) context2.popView.findViewById(R.id.map_bubbleImage);
// imageView.setOnClickListener(new View.OnClickListener(){
//
// public void onClick(View v) {
// context2.popView.setVisibility(View.GONE);
// }
//
// });
// }
//
// return true;
// }
//
//}