Map API

Nutiteq Maps Lib SDK enables developing advanced mobile mapping applications.
Platforms: Android, RIM BlackBerry, Java ME (J2ME)
Download maps API SDK »
Untitled Document

Products

» View demos
» Downloads

Latest news

Last at Tue, 3 Apr 2012 23:31:42
Topic: MapXT SDK evaluation
See more news »

Problem with KmlUrlReader

7 replies [Last post]
surajhpatil
User offline. Last seen 14 weeks 11 hours ago. Offline
Joined: 01/31/2012

Hello there,
I'm trying to load multiple kml layers to my map. But having problem, that all of the layers contains same icon.

I try to use,
public KmlUrlReader(java.lang.String kmlUrl,
int maxElements,
boolean needsUpdateAfterRead,
java.lang.String defaultIcon);

method. But after specifying string at "defaultIcon" with my drawable icon i can't see any icons over my map.

I have also tried to load online url from google but thats also wont work.

Please help.

Here is example:

private static final KmlUrlReader KML_PTP_SIGNAL = new KmlUrlReader(
"http://punetrafficpolice.gov.in:8080/geoserver/wms?service=WMS&version=1.1.0&request=GetMap&layers=indictrans:signal&styles=&srs=EPSG:4326&format=application%2Fvnd.google-earth.kml%2Bxml&width=512&height=447&bbox=73.829,18.51,73.853,18.531&",25,
true,"@drawable/traffic_signals");

jaak
User offline. Last seen 15 hours 31 min ago. Offline
Joined: 06/19/2008

You have to put your traffic_signals.png image to /assets directory of your project, and refer it to as "/assets/traffic_signals.png". If you have image with different resolutions, then this has to be handled in your code, SDK does not do it automatically as it would work with drawables.

private static final KmlUrlReader KML_POLY_LINE = new KmlUrlReader("/assets/Google_KML_Samples.kml", 1000, false, "/assets/osmico.png");

/JaakL

surajhpatil
User offline. Last seen 14 weeks 11 hours ago. Offline
Joined: 01/31/2012

Hey, Thanks for that! It works for me.

But what about the polygon or line kmls? Where i want to load the default icon from respective kml. For example,
for my parking line data i have already set the icon as

http://icons.opengeo.org/markers/icon-line.1.png

but when i load this kml it shows me the default icon.

Can you help me in this issue?

jaak
User offline. Last seen 15 hours 31 min ago. Offline
Joined: 06/19/2008

What is the problem with lines and polygons? They can't have any icons. If KML is loaded, then initially it has default icon, until real icons is downloaded from online and shown. If there is issue of finding/downloading icon, then it default icon remains there. I would need to see your KML to give specific assistance, there could be known limitations in KML parsing.

/JaakL

surajhpatil
User offline. Last seen 14 weeks 11 hours ago. Offline
Joined: 01/31/2012

Ok.Thanks for reply, here is my kml code for parking lot which is a polygon feature.
.
.
http://paste2.org/p/1895809

surajhpatil
User offline. Last seen 14 weeks 11 hours ago. Offline
Joined: 01/31/2012

Well Sorry to say, but above code is not working.....sorry for that,
here i'm giving you my another line feature named indictrans-parking_oddeven.kml

http://paste2.org/p/1895875

jaak
User offline. Last seen 15 hours 31 min ago. Offline
Joined: 06/19/2008

You have in-line placemark styles, i.e. styles are in Placemark element. We don't support this. You should define Styles as separate set of styles before placemarks, and then refer to them with styleUrl tag. See http://paste2.org/p/1897837 for working sample

/JaakL

ogatatsumi
User offline. Last seen 2 weeks 4 days ago. Offline
Joined: 08/09/2011

thanks