English 中文(简体)
如何在地图概览中确定适当的动物群集水平?
原标题:How to set a suitable zoom level on the mapview ?
        mMapController.animateTo(mAllSpots.get(0));
        mMapController.setCenter(mAllSpots.get(0));
        mMapController.setZoom(getZoomSize(mAllSpots));

有11个不同点,我想在地图概览中显示,我希望看到所有11个要点。 因此,适当的动物群落水平是什么? 感谢。

最佳回答
mMapController.animateTo(mAllSpots.get(0));

这是为了把具体/客观地点地图拼凑起来。

mMapController.setCenter(mAllSpots.get(0));

这份地图以特定理由为基础,作为地点价值

mMapController.setZoom(getZoomSize(mAllSpots));

这1是为了确定你需要使用这种方法的血清层。

mMapController.zoomToSpan(latSpan, longSpan);

这里,lat子和长Span由最高层和最高层—— minlng来界定,首先,你们都需要找到专线、专角和最高层、最大程度,而不是以你在这方面必须达到的价值来加以解释,这样,我们就将发挥动物、动物、动物、中心的作用。

<><>Edited>

你们需要从地图学中找到,这将给你像用你的话说的地图。

p1 = 20.212323,68.803209;
p2 = 20.222342,68.889898; 
p3 = 22.212232,68.802093;

如今,这已成为min、min、max、max、max子的,子。

minlat = 20.212232, minlng = 68.802093, maxlat = 22.212232, maxlng = 68.8898

latspan = maxlat - minlat, lngspan = maxlng - minlng

并且,你需要改写为地点,以1e6,如 latspan*1e6和lngspan*1e6,现在改为功能

问题回答

你或许应该利用项目执行来表明你的观点。 如果你这样做,你也可以利用这些手法为你做所有工作:

// Sets zoom to a level that will show all of your points.
mapView.getController().zoomToSpan(itemizedOverlay.getLatSpanE6(),
    itemizedOverlay.getLonSpanE6());

// Animates to center (mean, mean) of points.
mapView.getController().animateTo(itemizedOverlay.getCenter());




相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...

热门标签