我想在Java Swing桌面应用程序中支持Google Maps。 是否有免费提供的Swing Google地图组件? 如果它是可扩展的并且可能支持其他地图,例如OpenStreetMaps,那将是一件好事。
我的程序使用谷歌地图的Web服务指示来查找两点之间的路线。 结果被解析并存储在变量中。 然后,此变量用于撰写Google静态地图url。 解析和URL正常工作。 问题是绘制的“路线”穿过湖泊和山脉。 { String GPS = “-22.978823,-43.233249”; String link = MAPS_BASE_URL + “center=brazil,” + GPS + “&markers=color:blue|brazil,” + GPS + “&path=color:0xff0000ff” + “%s” + “&zoom=13&size=1024×1024&sensor=false”; String htmlContent = “”; String direction_URL= “”; URL url = null; String parsedStr = null; Scanner scan = null; origin = GPS; destination =”Maracanã”; try { direction_URL […]
在下面的代码中,我的updateLocation方法中的if(map!=null && mapIsReady==true) {…}内容永远不会被调用。 知道为什么吗? package com.noureddine_ouertani.www.wocelli50; import android.Manifest; import android.content.Context; import android.content.pm.PackageManager; import android.graphics.Color; import android.location.Criteria; import android.location.Location; import android.location.LocationListener; import android.location.LocationManager; import android.net.Uri; import android.os.Bundle; import android.os.PowerManager; import android.support.annotation.NonNull; import android.support.v4.app.ActivityCompat; import android.support.v4.app.FragmentActivity; import android.widget.Toast; import com.google.android.gms.appindexing.Action; import com.google.android.gms.appindexing.AppIndex; import com.google.android.gms.common.ConnectionResult; import com.google.android.gms.common.api.GoogleApiClient; import com.google.android.gms.location.LocationServices; import com.google.android.gms.maps.CameraUpdateFactory; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.OnMapReadyCallback; import com.google.android.gms.maps.SupportMapFragment; […]
目前我正在使用此代码查询谷歌地图以查找从地址到另一个地址的路线,然后我只是从其GeometryCollection的mapview上绘制它。 但这还不够,我还需要从kml中提取总预期持续时间。 有人可以提供一些示例代码来帮助我吗? 谢谢 StringBuilder urlString = new StringBuilder(); urlString.append(“http://maps.google.com/maps?f=d&hl=en”); urlString.append(“&saddr=”);//from urlString.append( Double.toString((double)src.getLatitudeE6()/1.0E6 )); urlString.append(“,”); urlString.append( Double.toString((double)src.getLongitudeE6()/1.0E6 )); urlString.append(“&daddr=”);//to urlString.append( Double.toString((double)dest.getLatitudeE6()/1.0E6 )); urlString.append(“,”); urlString.append( Double.toString((double)dest.getLongitudeE6()/1.0E6 )); urlString.append(“&ie=UTF8&0&om=0&output=kml”); //Log.d(“xxx”,”URL=”+urlString.toString()); // get the kml (XML) doc. And parse it to get the coordinates(direction route). Document doc = null; HttpURLConnection urlConnection= null; URL url = null; try { […]
当我使用带有CloudBackendMessaging.TOPIC_ID_BROADCAST的subscribeToCloudMessage()函数作为在CloudBackendFragment.java中完成的topicId时,一切正常但是当我给这个函数我自己的字符串时,我收到以下消息: 错误: m.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request “code”: 400, “errors”: [ { “domain”: “global”, “message”: “SubscriptionIDs: String properties must be 500 characters or less. Instead, use com.google.appengine.api.datastore.Text, which can store strings of any length.”, “reason”: “badRequest” } ], “message”: “SubscriptionIDs: String properties must be 500 characters or less. Instead, use com.google.appengine.api.datastore.Text, which can store strings of […]
这是我的代码。 没有编译错误,但我没有获得所需的输出:地图没有出现。 我想在我的JPanel中打开Google静态地图,并希望将其保存在我的本地驱动器上。 这是我正在使用的代码。 请指导我出错的地方。 try { String imageUrl = “http://maps.google.com/staticmap?center=40,26&zoom=1&size=150×112&maptype=satellite&key=ABQIAAAAgb5KEVTm54vkPcAkU9xOvBR30EG5jFWfUzfYJTWEkWk2p04CHxTGDNV791-cU95kOnweeZ0SsURYSA&format=jpg”; String destinationFile = “image.jpg”; str = destinationFile; URL url = new URL(imageUrl); InputStream is = url.openStream(); OutputStream os = new FileOutputStream(destinationFile); byte[] b = new byte[2048]; int length; while ((length = is.read(b)) != -1) { os.write(b, 0, length); } is.close(); os.close(); } catch (IOException […]
我想知道是否有一个Java库充当Google Maps API的包装器。 我感兴趣的是在我的桌面应用程序上显示特定区域(lon,lat)的卫星地图。 它不一定是谷歌地图,任何地图服务都可以做到这一点。 我需要的是一个与桌面客户端一起工作的库,没有javascript,GWT等。 有任何想法吗?
如何在谷歌地图中更改MyLocationOverlay的默认蓝色动画标记?
我使用Google Maps API创建了一个应用。 经过几个小时的尝试解决错误,我成功地运行了它(没有崩溃)。 但现在我收到了一个错误。 该警报意味着“除非您更新Google Play服务,否则应用程序将无法运行”。 我在模拟器中听说过这个错误,但我使用的是真正的设备(在Gingerbread上使用LG P350)。 我有android 2.3的设备所以我使用SupportLibrary。 我的活动档案 和AndroidManifest 有任何想法吗?
我想在JPanel上嵌入谷歌地图。 由于我想要放大/缩小等function,因此使用静态图像是不可行的。 为实现这一目标,我可能需要在我的Java桌面应用程序中嵌入一个网页(显示谷歌地图)。 我已经读过,我需要像WebKit(备选方案?)这样的东西才能实现这一目标。 我很感激任何帮助我的帮助: 在Jpanel中嵌入网页。 该网页显示谷歌地图。