[mapguide-users] Re: how to add an vehicle icon and trace line to
mapguide ?
captainst
quchenxy at yeah.net
Tue Sep 27 05:49:44 EDT 2011
After 2 days's painful struggle with html, asp.net, openlayers, javascripts,
etc , I managed to come up with a working demo:
http://osgeo-org.1803224.n2.nabble.com/file/n6835328/openlayer_icon_with_mapguide.jpg
The steps are:
1. Create a map
2. Create a layer with Mapguide definitions (Mapguide.html in openlayers
example)
3. Add the layer to the map
4. Create a vector layer with /new OpenLayers.Layer.Vector/, and insert a
style map, in which specify the "externalGraphic" attribute to the external
.png file (vector-features.html in openlayers example)
5. Add the layer to the map
6. Create a point with /new OpenLayers.Geometry.Point(xxx, yyy)/;
7. Create a vector feature using the point by /new
OpenLayers.Feature.Vector(point)/
8. Add some attributes to the vector feature if the style map mentioned
above uses "${}"
9. add the feature to the vector layer by /vectorLayer.addFeatures();/
Very rustic steps for beginners like me. It is really a challenge to make a
working stuff like this if you know almost nothing about html, javascript,
openlayers ...
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/how-to-add-an-vehicle-icon-and-trace-line-to-mapguide-tp6824597p6835328.html
Sent from the MapGuide Users mailing list archive at Nabble.com.
More information about the mapguide-users
mailing list