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");
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?
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.
Ok.Thanks for reply, here is my kml code for parking lot which is a polygon feature.
.
.
http://paste2.org/p/1895809
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
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
thanks
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