耳麦苹果7微信语音有时有杂音有时没声只有一边出声还有杂音

OpenStreetMap开发文档 - 简书
OpenStreetMap开发文档
OpenStreetMap社区是一个由地图制作爱好者组成的社区,这些爱好者提供并维护世界各地关于道路、小道、咖啡馆、铁路车站等各种各样的数据。OpenStreetMap开源项目可以让程序开发更加灵活,图源更加丰富,例如可以使用谷歌地图,以解决国内无法使用谷歌服务的尴尬。国内户外导航软件,例如:、和都使用了OpenStreetMap。
Android版OpenStreetMap的github地址:
5.2地图缓存的是瓦片,5.4之后地图缓存到数据库
一、环境配置
1、Gradle中添加依赖
compile 'org.osmdroid:osmdroid-android:5.2@aar'
2、权限配置
&uses-permission android:name="android.permission.INTERNET"/&
&uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/&
&uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/&
提示:编译版本为23或以上版本,要注意动态获取读写存储空间权限,否则地图可能不显示
二、基础MapView使用
1、使用内置地图源
(1)、在布局文件中添加MapView控件,在代码中找到控件并设置图源
&org.osmdroid.views.MapView
android:id="@+id/mapView"
android:layout_width="match_parent"
android:layout_height="match_parent"/&
MapView mMapView= (MapView) findViewById(R.id.mapView);
mMapView.setTileSource(TileSourceFactory.CYCLEMAP);//(OCM等高)若不设置,则默认使用的是MAPNIK(OSM街道)
(2)、直接在代码中new MapView,然后设置图源,并将MapView添加到父布局中
MapView mMapView=new MapView(this);
mMapView.setTileSource(TileSourceFactory.MAPNIK);
2、设置其他地图源
(1)、谷歌图源
a、新建一个谷歌图源类,继承OnlineTileSourceBase
public class GoogleMapsTileSource extends OnlineTileSourceBase {
* @param aName
a human-friendly name for this tile source
自定图源义名字,会在手机外部存储中新建以该名字命名的文件夹,瓦片存储在其中
* @param aZoomMinLevel
the minimum zoom level this tile source can provide
最小缩放级别
* @param aZoomMaxLevel
the maximum zoom level this tile source can provide
最大缩放级别
* @param aTileSizePixels
the tile size in pixels this tile source provides
瓦片质量 (256)
* @param aImageFilenameEnding the file name extension used when constructing the filename
瓦片格式(jpg[有损压缩率高、不透明]、png[无损、透明])
* @param aBaseUrl
the base url(s) of the tile server used when constructing the url to download the tiles
下载瓦片的链接(前缀)
public GoogleMapsTileSource(String aName, int aZoomMinLevel, int aZoomMaxLevel, int aTileSizePixels, String aImageFilenameEnding, String[] aBaseUrl) {
super(aName, aZoomMinLevel, aZoomMaxLevel, aTileSizePixels, aImageFilenameEnding, aBaseUrl);
public String getTileURLString(MapTile aTile) {
return getBaseUrl() + "&x=" + aTile.getX() + "&y=" + aTile.getY() + "&z=" + aTile.getZoomLevel();
b、new一个谷歌图源对象,并设置MapView图源
String str1 = "/vt/lyrs=m&hl=zh-CN&gl=cn&scale=2";
String str2 = "/vt/lyrs=m&hl=zh-CN&gl=cn&scale=2";
String str3 = "/vt/lyrs=m&hl=zh-CN&gl=cn&scale=2";
String str4 = "/vt/lyrs=m&hl=zh-CN&gl=cn&scale=2";
GoogleMapsTileSource googleMapsTileSource = new GoogleMapsTileSource("GoogleNormal", 2, 19, 256, ".png", new String[]{str1, str2, str3, str4});
mMapView.setTileSource(googleMapsTileSource);
(2)、必应等图源,使用方法类似于谷歌图源
参考文档:
3、让瓦片适应不同像素密度
默认地图显示的字体小,图片像素高,可设置以下代码,使地图适应不同像素密度,更美观
mMapView.setTilesScaledToDpi(true);
4、添加指南针
CompassOverlay mCompassOverlay = new CompassOverlay(MainActivity.this, new InternalCompassOrientationProvider(MainActivity.this), mMapView);
mMapView.getOverlays().add(mCompassOverlay);
mCompassOverlay.enableCompass();
按此方法添加指南针之后,部分手机仍不显示指南针,原因未知
5、添加比例尺
ScaleBarOverlay mScaleBarOverlay = new ScaleBarOverlay(mMapView);
mMapView.getOverlays().add(mScaleBarOverlay);
添加上面代码后,比例尺显示在左上角,而且不美观,可以继续添加下面代码,使比例尺显示在左下角
mScaleBarOverlay.setAlignBottom(true);
mScaleBarOverlay.setLineWidth(1 * (getResources().getDisplayMetrics()).density);
mScaleBarOverlay.setMaxLength(0.85f);
6、设置地图中心
GeoPoint geopoint = new GeoPoint(39.6.400025);
MapController mMapController= (MapController) mMapView.getController();//获取MapView控制器
mMapController.setCenter(geopoint);//设置地图中心
7、其他设置
(1)、设置缩放界别
mMapController.setZoom(15);//设置缩放级别
(2)、设置缩放按钮可见
mMapView.setBuiltInZoomControls(true);//设置缩放按钮可见
(3)、设置多指触控可用
mMapView.setMultiTouchControls(true);//设置多指触控可用
(4)、关闭硬件加速
mMapView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);//关闭硬件加速(绘制轨迹时需要)
(5)、地图可旋转
RotationGestureOverlay mRotationGestureOverlay = new RotationGestureOverlay(this, mMapView);
mRotationGestureOverlay.setEnabled(true);
mMapView.getOverlays().add(mRotationGestureOverlay);
三、进阶使用
1、自定义瓦片缓存位置
默认会在外部存储中新建名为somdroid的文件夹,瓦片就存储在其中。
自定义缓存位置就是在外部存储中创建一个文件夹,然后设置为瓦片的缓存位置,放在MapView初始化之前例如:
File dir = new File(Environment.getExternalStorageDirectory(), "AAA");//新建文件夹
if (dir.exists()) {
File nomedia = new File(dir.getAbsoluteFile() + "/.nomedia");
if (!nomedia.exists()) {
nomedia.createNewFile();
} catch (IOException e) {
e.printStackTrace();
dir.mkdirs();
File file = dir.getAbsoluteFile();
new File(file + "/.nomedia").createNewFile();
} catch (Exception ex) {
android.util.Log.e(IMapView.LOGTAG, "unable to create a nomedia file. downloaded tiles may be visible to the gallery.", ex);
OpenStreetMapTileProviderConstants.setCachePath(dir + "");//设置MapView的缓存路径
2、添加Marker
Marker marker = new Marker(mMapView);
marker.setIcon(getResources().getDrawable(R.mipmap.ic_launcher));//设置图标
marker.setPosition(geopoint);//设置位置
marker.setAnchor(0.5f, 0.5f);//设置偏移量
marker.setTitle("我是Titile");//设置标题
marker.setSubDescription("我是SubDescription");//设置说明
mMapView.getOverlays().add(marker);//添加marker到MapView
点击Marker之后会出现气泡,显示title和subDescription
PathOverlay pathOverlay = new PathOverlay(Color.BLUE, 10, this);
pathOverlay.addPoint(new GeoPoint(39.6.400025));
pathOverlay.addPoint(new GeoPoint(39.6.300025));
mMapView.getOverlays().add(pathOverlay);
连线时务必关闭硬件加速,否则可能显示不出来连的线
4、离线地图下载
CacheManager cacheManager = new CacheManager(mMapView);//获取下载器
BoundingBoxE6 boundingBoxE6 = mMapView.getBoundingBox();//获取当前区域
int tileNum = cacheManager.possibleTilesInArea(boundingBoxE6, 8, 16);//计算当前区域8-16级的瓦片数量
cacheManager.downloadAreaAsync(this, boundingBoxE6, 8, 16, new CacheManager.CacheManagerCallback() {//下载
public void onTaskComplete() {
//下载完成后的回调
下载时会有进度框,若点击进度框以外的区域会取消下载,若想修改逻辑可参考CacheManager,自定义一个CacheManage
记录生活,分享技术~
个人博客:/OpenStreetMap 地图数据编辑器:iD
来源:open开发经验库
iD 是一个完全使用 JavaScript 开发的 OpenStreetMap 地图数据编辑器。无需 Flash 运行,完全采用 HTML5 和使用 D3 视觉库进行设计。
项目主页:
免责声明:本站部分内容、图片、文字、视频等来自于互联网,仅供大家学习与交流。相关内容如涉嫌侵犯您的知识产权或其他合法权益,请向本站发送有效通知,我们会及时处理。反馈邮箱&&&&。
学生服务号
在线咨询,奖学金返现,名师点评,等你来互动我要综合发帖模板
查看: 7207|回复: 13
抓图好工具----奥维正式提供OpenCycle地形图,远超谷歌地形图.
综合发帖模板
适用系统(可多选):
Android2.0/2.2&WM&WINDOWS&
中国 & 中国
支持分辨率(可多选):
资源分类(可多选):
官方主程序&
奥维正式提供OpenCycle地形图,远超谷歌地形图
官方下载地址:
Opencycle泰山
j07b!j:&\}&&
Opencycle重庆
太专业了,我通常就用奥维下载地图,手指选几个点系统自动下载区间内的地图,1-18级可选,因为经常山林穿越,所以常用14-18地图,存储空间消耗巨大,呵呵。方便极了。
手机上安装个6只脚,到哪里想用什么就下载什么,包括这个opencycle
太强大 谢谢
是的,我使用下来也感觉非常不错,赞一个。
目前用户群好像不大,公司应该好好推广一下。
好像捧场的人很多哦
我使用感觉非常非常不错.公司应该好好推广一下,赞赞赞赞赞赞!!!!!!!
谢谢,应该好好推广一下
能够下载地形图离线应用是唯一优势
应该好好推广
这个奥维的还有一个好处:它有个pc版 可以在pc上下载离线地图或者在pc上进行规划路线再同步到手机上。手机上做这些还是有些不方便的
非常好,谢谢
这个地图真心可以
奥维能不能下载地图文件或图片用到ozi上?
Powered byWeb Mining Company
SmartViper menu
Domain research
Network tools
Smartviper services
Indexed pages:
(▼2)
Backwards:
(▼226)
Links from homepages:
links (from 11 hosts)updated November 6, 2013
Homepage links:
internal , external
Unique visitors:
(▼ 319)diff as of July 1, 2013
HTML validation:
DNS resolve:
Domain worth:
Health score:
Website availability:
(is site down?)
Used technologies:
Google Analytics
Javascript frameworks
OpenLayers
Web servers
Hosting abuse phone:
office +1-888-401-4678
Hosting abuse mail:
Domain IP:
74.220.215.69 United States
IP neighborhood:
31 other domains, examples:
, , , , , , , , , , , , , , , , , , ,
DNS Resolve:
Domain registrar:
Public Interest Registry
Domains using same registrar:454,463
Domain owner:
Andrew Allan
Address: 86 Hailsham Avenue, London, SW2 3AH, GB
Mail: hostmonster@gravitystorm.co.uk
Public registrar record:
Unique visitors:
(▼ 319)diff as of July 1, 2013
Domain age:
9 years and 5 months
Domain worth:
Health score:
Domain score widget:
Domain worth widget:
Smartviper certification:
Social #opencyclemap.org
Social activity:
updated 19 Aug 2014
Twitter: 490 tweets (+3 new tweets for the last 14 days) Google+: 112 shares (+112 new shares for the last 77 days) LinkedIn: 19 likes (+2 new likes for the last 283 days) Delicious: 528 bookmarks (+528 new bookmarks
for the last 70 days) Facebook:&308 likes (+4 likes for the last 14 days)& &1,258 shares (+15 shares for the last 7 days)& &376 comments (+13 comments for the last 14 days)
Smartviper reviews:
Similar sites
Related domains:bases on topics
, , , , , , , , , .
More info on
Advertising
AdSense Checker:
(AdSense Checker:)
Is domain banned from using Google Adsense?
Tags prominence:(important page elements, estimated advertising value)
base layer (80%), cc by (20%)
Ads SERP visibility:
based on research of 16,000,000 keywords
Audience location:
Minimum required screen width is 768 - Please use other device to view
SERP organic visitors pie
Visualizes local performance of organic positions. Positions visibility distribution is presented by Country showing each country's share in %
Indexed pages:
(▼2)
Backwards:
(▼226)
Homepage links:
internal , external
HTML validation:
OpenCycleMap.org - the OpenStreetMap Cycle Map
Links from homepages:(detailed)
15 links (from 11 unique hosts)
Examples: , , , , , , , , , , , ,
Smartviper Domain RSS:
Get the latest updates on
SERP organic visibility:
based on research of 16,000,000 keywords
Domain name is seen on 52 search engine queries. Average position in SERP is 17. Best position in SERP for this domain is #1 (it's found 2 times). Statistical information was collected from April 20, 2012 to April 22, 2012
SERP organic rankings distribution:
Visualizes organic positions distribution for domain pages that were found in top 40 results.
Domain worth:
SmartViper &. All rights reserved. Version dkv760107
SmartViper &. All rights reserved. Version dkv760107}

我要回帖

更多关于 苹果7微信语音有时有杂音有时没声 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信