Currently using openlayers as map u开发者_如何学Goi on my web app. The problem is i confused with many different layer type supported on Openlayers (which mean good btw). So anyone can suggest a suitable layer for this?
My goal is simple, i just want to create a layer which contain line as "tracking line" (let's call it "track") like what we can see here: OpenStreetMaps Example
Right now currently using PointTrack and GeoRSS to display the track layer, also i have considered using KML layer now since it more versatile.
The consideration to take:
- It must be fast enough to render on all browsers (especially IE8)
- It loads data from other source (such as kml or xml file)
- Refreshable
- Styleable (size,color,etc)
PS: attach a sample if available
I would prefer to use OpenLayers.Layer.Vector in this situation. It's very flexible when it comes to styling features and you have full control over the contents of the layer(refreshable).
It doesn't matter in what format you have your data as you can read many different formats with OpenLayers.Format.* classes. So you use whatever format you need to create features and add then add them to you Vector layer.
How fast it renders data depends on how much data you have. IE tends to perform poorly when you throw a lot of vector data to the map.
You can see basic example here
EDIT: If you need to display a lot of data on a map then you probably would consider using WMS layer.
There is similar problem and solution to it described here.
Your data is rendered on server and is sent to the client as an image. You loose some flexibility comparing when you do everything on the client though.
精彩评论