谷歌Android地图谈论谷歌地图企业数据? [英] Android Google Maps talking to Google Maps Enterprise Data?
问题描述
是否有可能切换Android版谷歌地图code利用由谷歌提供的企业自定义数据?
Is it possible to switch the Android Google Maps code to utilize custom data provided by a Google Enterprise?
详细信息:
谷歌提供的地图服务,在这里您可以举办自己的数据的企业的版本。看这里:
http://www.google.com/enterprise/earthmaps/earth_technical.html
但Android的地图API没有使用比在网络上免费提供其他任何替代数据源的方式。
HTTP://$c$c.google.com /android/add-ons/google-apis/index.html
But Android's Maps API has no way of using any alternative data sources other than what is freely available on the web. http://code.google.com/android/add-ons/google-apis/index.html
有像开放街道地图或其他AndNav工具,但在这里,我需要使用谷歌。
There are other tools like Open Street Maps or AndNav, but here, I need to use Google.
推荐答案
在Android上使用,你可以通过自定义设置TileProvider瓷砖源新V2 API。我不熟悉的企业级产品,但是这应该是可能的,如果瓷砖通过一个URL可用。确切的实施将取决于瓷砖的方式访问,但这里有些code上手:
With the new V2 api on android you can set the tile source by providing a custom TileProvider. I am not familiar with the enterprise offerings, but this should be possible if the tiles are available via a url. The exact implementation will depend on how the tiles are accessed, but here some code to get started:
map.setMapType(GoogleMap.MAP_TYPE_NONE);
TileOverlayOptions options = new TileOverlayOptions();
options.tileProvider(new UrlTileProvider(256, 256) {
@Override
public URL getTileUrl(int x, int y, int z) {
try {
String f = "http://yourURL/%d/%d/%d.png";
return new URL(String.format(f, z, x, y));
}
catch (MalformedURLException e) {
return null;
}
}
});
map.addTileProvider(选项);
map.addTileProvider(options);
这篇关于谷歌Android地图谈论谷歌地图企业数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!