Talk:OpenLayers Simple Example
From OpenStreetMap
Discuss OpenLayers Simple Example
lonLatToMercator() function
It would perhaps be a good idea to add the lonLatToMercator() function (from the OSM site here: [1]) to the example, parse the default lat/lon into with this function so that it is obvious what is happening at this step.
It would probably help to define the initial lat/lon as an OpenLayers lat/lon object, too. --Thomas Wood 19:22, 17 October 2007 (BST)
- ...and he did it! - Harry Wood 17:18, 11 December 2007 (UTC)
Reverted non-simple browser detecting and code wrapping stuff
User:Sil has made an edit which I think I'm going to revert because it's supposed to be a simple example. I think the point of this new code is to make it easier to drop the javascript in to a page which already has javascript. Am I understanding that right? I guess it also means it can appear inline without needing anything in the <body> tag.
But generally I would say it definately doesn't fit the criteria of providing a simple example. One nice thing about keeping it simple, is that if a developer can understand it, then they'll be able to figure out the necessary shoehorning into existing pages anyway.
-- Harry Wood 17:18, 11 December 2007 (UTC)
Adding segments (lines) on an OpenLayers map?
So, this is the coolest thing since sliced butter. I've seen the Openlayers POI layer example for how I can add points of interest, but is there any way I can add segments (lines between points) on an OSM map? In particular, I'd like to graphically display flight routes (London-New York, etc) between arbitrary lat/lon points. Just a simple straight line would be fine for starters, but for extra credit, geometrically accurate curved line projections would be even nicer. Jpatokal 12:44, 18 July 2008 (UTC)
- Reply to self: apparently PointTracks do pretty much what I need. Jpatokal 12:48, 18 July 2008 (UTC)
- hmmm. Haven't tried it, but I was playing with the OpenLayers examples, and noticed there's one which lets the user draw lines onto the map: http://openlayers.org/dev/examples/drag-feature.html ...Positioning some static lines should be less complex than that I guess. -- Harry Wood 13:23, 18 July 2008 (UTC)
- You can also render many common geographic files such as KML, GML, GeoRSS etc through use of the GML layer and the appropriate Format object. The API docs contain more info. --Thomas Wood 17:01, 18 July 2008 (UTC)

