如何在worldwind Android中为Geoserver提供WMS URL?

时间:2015-02-25 07:24:27

标签: java android worldwind

如何在Android中为Worldwind提供geoserver网址?

在桌面版我提供

  

http://localhost:8090/geoserver/WorldWind/wms?service=WMS

它对我有用,但是同样的url在Qglobe Android应用程序代码中不起作用。

因为它没有显示wms中的getcapabilities列表,并且在WWXML类中显示错误。

getcapabilities not showing

它在控制台

中显示以下错误
  

02-25 14:36:35.805:W / System.err(333):at gov.nasa.worldwind.util.WWXML.openEventReaderURL(WWXML.java:450)   02-25 14:36:35.805:W / System.err(333):at gov.nasa.worldwind.util.WWXML.openEventReader(WWXML.java:491)   02-25 14:36:35.805:W / System.err(333):at gov.nasa.worldwind.util.WWXML.openEventReader(WWXML.java:466)   02-25 14:36:35.815:W / System.err(333):at gov.nasa.worldwind.ogc.OGCCapabilities.createReader(OGCCapabilities.java:91)   02-25 14:36:35.815:W / System.err(333):at gov.nasa.worldwind.ogc.OGCCapabilities。(OGCCapabilities.java:72)   02-25 14:36:35.815:W / System.err(333):at gov.nasa.worldwind.ogc.wms.WMSCapabilities。(WMSCapabilities.java:71)   02-25 14:36:35.815:W / System.err(333):at gov.nasa.worldwind.ogc.wms.WMSCapabilities.retrieve(WMSCapabilities.java:40)   02-25 14:36:35.815:W / System.err(333):at com.qq.worldwind.android.layer.WMSLayerType.downloadCapabilities(WMSLayerType.java:146)   02-25 14:36:35.815:W / System.err(333):at com.qq.worldwind.android.layer.WMSLayerType.access $ 0(WMSLayerType.java:139)   02-25 14:36:35.815:W / System.err(333):at com.qq.worldwind.android.layer.WMSLayerType $ 2 $ 1.run(WMSLayerType.java:117)   02-25 14:36:35.815:W / System.err(333):at java.lang.Thread.run(Thread.java:1019)   02-25 14:36:35.815:W / System.err(333):引起:java.net.ConnectException:localhost / 127.0.0.1:8090 - 连接被拒绝   02-25 14:36:35.815:W / System.err(333):at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:207)   02-25 14:36:35.815:W / System.err(333):at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:437)   02-25 14:36:35.815:W / System.err(333):at java.net.Socket.connect(Socket.java:983)   02-25 14:36:35.825:W / System.err(333):at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection。(HttpConnection.java:75)   02-25 14:36:35.825:W / System.err(333):at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection。(HttpConnection.java:48)   02-25 14:36:35.825:W / System.err(333):at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection $ Address.connect(HttpConnection.java:322)   02-25 14:36:35.825:W / System.err(333):at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionPool.get(HttpConnectionPool.java:89)   02-25 14:36:35.825:W / System.err(333):at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getHttpConnection(HttpURLConnectionImpl.java:285)   02-25 14:36:35.825:W / System.err(333):at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.makeConnection(HttpURLConnectionImpl.java:267)   02-25 14:36:35.834:W / System.err(333):at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.retrieveResponse(HttpURLConnectionImpl.java:1018)   02-25 14:36:35.834:W / System.err(333):at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:512)   02-25 14:36:35.834:W / System.err(333):at java.net.URL.openStream(URL.java:645)   02-25 14:36:35.834:W / System.err(333):at gov.nasa.worldwind.util.WWXML.openEventReaderURL(WWXML.java:444)   02-25 14:36:35.834:W / System.err(333):... 10 more

如何在Android Worldwind上显示我的地理服务器图层?

此外,地球仪在Android模拟器中无法正常显示。

任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:1)

您可以在模拟器中使用10.0.2.2代替localhost

http://developer.android.com/tools/devices/emulator.html#networkaddresses