speed up iphone application that is loading a KML file for mapView overlays
I am wondering if there is a more efficient way to load my KML file for my mapView overlays? The kml is pretty complex and how I am doing it seems to be bogging my app down pretty bad. I am using Apples KMLParser... As is th=is app works, but like I said, it is very slow to update when any changes are made:
// Get bike path Polyline
NSURL *url = [NSURL URLWithString:@"doc.kml"];
kml = [[KMLParser parseKMLAtURL:url] retain];
[url release];
Thanks for your he开发者_如何学Pythonlp
If you're serious about setting up a scalable environment, you should consider installing something like MapServer or GeoServer on the server where you host your kml document now.
You can then decide whether to render your kml server-side (you'll get a bitmap image png/gif/jpg) or client-side (you'll fetch kml or json).
To set this up, you'll need the following:
- A postgres database.
- GeoServer/MapServer
In the postgres database you place the shapes that you need to show. GeoServer takes care of either rendering images, or putting together kml data from the database. It can even serve data as svg or pdf.
To finish this off, you could use OpenLayers on the client side.
Anyway, whatever you do, I don't recommend wasting your time rolling your own solution. The products I've mentioned above are very powerful and best of all: free.
精彩评论