当前位置: 首页>>代码示例>>Java>>正文


Java MarkerOptions类代码示例

本文整理汇总了Java中com.amap.api.maps2d.model.MarkerOptions的典型用法代码示例。如果您正苦于以下问题:Java MarkerOptions类的具体用法?Java MarkerOptions怎么用?Java MarkerOptions使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


MarkerOptions类属于com.amap.api.maps2d.model包,在下文中一共展示了MarkerOptions类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: updateDroneLocation

import com.amap.api.maps2d.model.MarkerOptions; //导入依赖的package包/类
private void updateDroneLocation(){

        LatLng pos = new LatLng(droneLocationLat, droneLocationLng);
        //Create MarkerOptions object
        final MarkerOptions markerOptions = new MarkerOptions();
        markerOptions.position(pos);
        markerOptions.icon(BitmapDescriptorFactory.fromResource(R.drawable.aircraft));

        runOnUiThread(new Runnable() {
            @Override
            public void run() {
                if (droneMarker != null) {
                    droneMarker.remove();
                }

                if (checkGpsCoordination(droneLocationLat, droneLocationLng)) {
                    droneMarker = aMap.addMarker(markerOptions);
                }
            }
        });
    }
 
开发者ID:lupwei,项目名称:Croprotector,代码行数:22,代码来源:WayPointActivity.java

示例2: getMarkerOptions

import com.amap.api.maps2d.model.MarkerOptions; //导入依赖的package包/类
private MarkerOptions getMarkerOptions(AMapLocation amapLocation) {
        //设置图钉选项
        MarkerOptions options = new MarkerOptions();
        //图标
        options.icon(BitmapDescriptorFactory.fromResource(R.drawable.ic_location_on_black_48dp));
        //位置
        options.position(new LatLng(amapLocation.getLatitude(), amapLocation.getLongitude()));
        StringBuffer buffer = new StringBuffer();
        buffer.append(amapLocation.getCountry() + "" + amapLocation.getProvince() + "" +
                amapLocation.getCity() + "" + amapLocation.getDistrict() + "" +
                amapLocation.getStreet() + "" + amapLocation.getStreetNum());
        //标题
        options.title(buffer.toString());
        //子标题
//        options.snippet("I'am Here!");
        //设置多少帧刷新一次图片资源
        options.period(60);

        return options;

    }
 
开发者ID:absentm,项目名称:myapplication,代码行数:22,代码来源:FindMapAroundAty.java

示例3: addMarker

import com.amap.api.maps2d.model.MarkerOptions; //导入依赖的package包/类
private void addMarker(LatLng latLng, String url) {
        AsyncImageView imageView = (AsyncImageView) LayoutInflater.from(this).inflate(R.layout.map_marker_view, null);
//        AsyncImageView imageView = (AsyncImageView) view.findViewById(R.id.icon);
        imageView.setResource(new Resource(url));

//        aMap.addMarker(new MarkerOptions().anchor(0.5f, 0.5f)
//                .position(new LatLng(30.679879, 104.064855)).title("成都市")
//                .snippet("成都市:30.679879, 104.064855").draggable(true));

        MarkerOptions markerOption = new MarkerOptions();
        markerOption.position(new LatLng(34.341568, 108.940174));
//        markerOption.title("西安市").snippet("西安市:34.341568, 108.940174");
//        markerOption.draggable(true);
//        markerOption.icon(BitmapDescriptorFactory.fromResource(R.drawable.rc_default_portrait));
        markerOption.icon(BitmapDescriptorFactory.fromView(imageView));
//        markerOption.icon(BitmapDescriptorFactory
//                .defaultMarker(BitmapDescriptorFactory.HUE_RED));


        Marker marker2 = aMap.addMarker(markerOption);
        // marker旋转90度
//        marker2.setRotateAngle(90);
    }
 
开发者ID:yangyunfeng666,项目名称:demo-app-android-v2-2.3.9,代码行数:24,代码来源:ShareLocationActivity.java

示例4: setMark

import com.amap.api.maps2d.model.MarkerOptions; //导入依赖的package包/类
/**
 * 在地图上设置标记图标
 *
 * @param type 图标的样式
 */
private void setMark(int type, Post post) {

    if (type == OTHER_MARK) {
        myMarkOption = new MarkerOptions();
        //添加用户覆盖物
        LatLng postCurrentLatLng = new LatLng(post.getLatitude(), post.getLongitude());
        myMarkOption.anchor(0.5f, 0.5f).
                position(postCurrentLatLng).title(post.getUsername()).snippet(post.getTag() + "@@" + post.getAddress() + "@@" + post.getTime()).
                draggable(false).icon(BitmapDescriptorFactory.fromResource(R.drawable.marker_ic));
        myMark = aMap.addMarker(myMarkOption);

    } else {
        //暂时还没有设计用户定位图标
    }
}
 
开发者ID:chenjunqian,项目名称:here,代码行数:21,代码来源:MainMapFragment.java

示例5: initMapView

import com.amap.api.maps2d.model.MarkerOptions; //导入依赖的package包/类
private void initMapView() {

        if (aMap == null) {
            aMap = mapView.getMap();
            aMap.setOnMapClickListener(this);// add the listener for click for amap object
        }

        LatLng shenzhen = new LatLng(22.5362, 113.9454);
        aMap.addMarker(new MarkerOptions().position(shenzhen).title("Marker in Shenzhen"));
        aMap.moveCamera(CameraUpdateFactory.newLatLng(shenzhen));
    }
 
开发者ID:lupwei,项目名称:Croprotector,代码行数:12,代码来源:WayPointActivity.java

示例6: markWaypoint

import com.amap.api.maps2d.model.MarkerOptions; //导入依赖的package包/类
private void markWaypoint(LatLng point){
    //Create MarkerOptions object
    MarkerOptions markerOptions = new MarkerOptions();
    markerOptions.position(point);
    markerOptions.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_BLUE));
    Marker marker = aMap.addMarker(markerOptions);
    mMarkers.put(mMarkers.size(), marker);
}
 
开发者ID:lupwei,项目名称:Croprotector,代码行数:9,代码来源:WayPointActivity.java

示例7: addMarkersToMap

import com.amap.api.maps2d.model.MarkerOptions; //导入依赖的package包/类
/**
 * 在地图上添加marker
 */
private void addMarkersToMap() {
    List<Post> posts = mockPosts();
    for(Post post:posts){
        MarkerOptions markerOption = new MarkerOptions().icon(BitmapDescriptorFactory
                .defaultMarker(BitmapDescriptorFactory.HUE_AZURE))
                .position(post.getPosition())
                .draggable(true);
        aMap.addMarker(markerOption).setObject(post);
    }
}
 
开发者ID:vinx13,项目名称:hack-nanjing-2017,代码行数:14,代码来源:MeFragment.java

示例8: addMarker

import com.amap.api.maps2d.model.MarkerOptions; //导入依赖的package包/类
private void addMarker(LatLng latlng) {
    if (mLocMarker != null) {
        return;
    }
    MarkerOptions options = new MarkerOptions();
    options.icon(BitmapDescriptorFactory.fromBitmap(BitmapFactory.decodeResource(this.getResources(),
            R.mipmap.navi_map_gps_locked)));
    options.anchor(0.5f, 0.5f);
    options.position(latlng);
    mLocMarker = mAMap.addMarker(options);
    mLocMarker.setTitle(LOCATION_MARKER_FLAG);
}
 
开发者ID:InnoFang,项目名称:FamilyBond,代码行数:13,代码来源:MapActivity.java

示例9: setLocation

import com.amap.api.maps2d.model.MarkerOptions; //导入依赖的package包/类
private void setLocation(double latitude,double longitude){
    if(aMap == null){
        return;
    }
    aMap.moveCamera(CameraUpdateFactory.changeLatLng(new LatLng(
            latitude, longitude)));
    MarkerOptions markerOption = new MarkerOptions();
    markerOption.position(new LatLng(latitude,
            longitude));
    markerOption.draggable(true);
    Marker marker = aMap.addMarker(markerOption);
    marker.setObject("11");//这里可以存储用户数据
}
 
开发者ID:yun2win,项目名称:yun2win-sdk-android,代码行数:14,代码来源:LocationActivity.java

示例10: addMarkerAtPointWithType

import com.amap.api.maps2d.model.MarkerOptions; //导入依赖的package包/类
@Override
public Marker addMarkerAtPointWithType(LatLng point, MarkerType markerType) {
    BitmapDescriptor bitmap = BitmapDescriptorFactory
            .fromResource(markerType == MarkerType.UserPoint ? R.drawable.box_black : R.drawable.box_grey);
    MarkerOptions options = new MarkerOptions().position(point).icon(bitmap).zIndex(1000).draggable(true).anchor(0.5f, 0.5f);
    return mAMap.addMarker(options);
}
 
开发者ID:void-main,项目名称:MapPolyDrawer,代码行数:8,代码来源:AMapDrawableMap.java

示例11: onMapClick

import com.amap.api.maps2d.model.MarkerOptions; //导入依赖的package包/类
@Override
public void onMapClick(LatLng latLng) {
    //main_content.setText(latLng.longitude+"\n"+latLng.latitude);
    latLngNow=latLng;

    if(marker != null){
        marker.remove();
    }
    marker=mAMap.addMarker(new MarkerOptions().position(latLng));
    requestWeather(latLng);
}
 
开发者ID:Abitalo,项目名称:WeatherDemo,代码行数:12,代码来源:MainActivity.java

示例12: lookAt

import com.amap.api.maps2d.model.MarkerOptions; //导入依赖的package包/类
public void lookAt(double latitude, double longitude, String title, String snippet) {
    LatLng latLng = new LatLng(latitude, longitude);
    AMap map = this.getMap();
    map.clear();
    MarkerOptions markerOptions = new MarkerOptions().position(latLng).title(title).snippet(snippet)
            .icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_RED));
    Marker marker = map.addMarker(markerOptions);
    if (title != null) {
        marker.showInfoWindow();
    }
    map.moveCamera(CameraUpdateFactory.newCameraPosition(new CameraPosition(latLng, 15, 0, 0)));
}
 
开发者ID:wavinsun,项目名称:MUtils,代码行数:13,代码来源:AMapView.java

示例13: mark

import com.amap.api.maps2d.model.MarkerOptions; //导入依赖的package包/类
public void mark(double lat, double lng, String title) {
    findViewById(R.id.mark_tv).setVisibility(View.VISIBLE);
    ((TextView) findViewById(R.id.mark_tv)).setText(title);
    aMap.addMarker(new MarkerOptions().anchor(0.5f, 0.5f)
            .position(new LatLng(lat, lng
            )).snippet(title));

}
 
开发者ID:MoonRune,项目名称:CuiTrip,代码行数:9,代码来源:GaoDeMapActivity.java

示例14: addMarkersToMap

import com.amap.api.maps2d.model.MarkerOptions; //导入依赖的package包/类
/**
	 * 在地图上添加marker
	 */
	private void addMarkersToMap() {

		markerOption = new MarkerOptions();
		markerOption.position(Constants.BEIJING_TUSHUGUAN);
		markerOption.title("北京朝阳区东三环南路88号").snippet("电话:010-67358114");
		markerOption.draggable(true);
//		markerOption.icon(BitmapDescriptorFactory
//				.fromResource(R.drawable.ico_notice_location));//自定义定位图片
		marker2 = aMap.addMarker(markerOption);

	}
 
开发者ID:SimonJoker,项目名称:OnTheRoad,代码行数:15,代码来源:ActivityContentAcvitity.java

示例15: defaultMarkerOptions

import com.amap.api.maps2d.model.MarkerOptions; //导入依赖的package包/类
private MarkerOptions defaultMarkerOptions() {
	MarkerOptions markerOptions = new MarkerOptions();
	markerOptions.anchor(0.5f, 0.5f);
	markerOptions.icon(BitmapDescriptorFactory.fromResource(R.drawable.pin));
	return markerOptions;
}
 
开发者ID:newDeepLearing,项目名称:decoy,代码行数:7,代码来源:NavigationAmapActivity.java


注:本文中的com.amap.api.maps2d.model.MarkerOptions类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。