[OSM-talk-be] maps with overlays : how to ?

Marc Coevoet sintsixtus at gmail.com
Mon Oct 8 18:26:26 UTC 2012


On Sun, Oct 7, 2012 at 1:59 PM, Nicolas Pettiaux <nicolas at pettiaux.be
> <mailto:nicolas at pettiaux.be>> wrote:
>
>     Dear,
>
>     I would like to have an OSM map with some addresses overlayed from the
>     following file that contains adresses in Brussels.
>
>     I would like to have something that let me
>     1/ print a map with large black dots, one per address,
>     2/ see the detailed information present in the file for each record,
>     when I pass the mouse on the dot when I am see the online map.
>

Bonjour Nicolas,

J'ai une carte de Bruxelles avec les arrets de bus de delijn.be

http://dxradio.woelmuis.nl/research/delijn/gemeente/gemeentewww/BRUSSEL-STAD.txt/


les autres villes:
http://dxradio.woelmuis.nl/research/delijn/gemeente/

Regardez le code source, et le format de "textfile.txt"

j'utilise openlayers.org

"il faudrait le copier, ymmv."

Marc
========++++========
<html xmlns="http://www.w3.org/1999/xhtml">
   <head>
     <style type="text/css">
#map {
         width: 100%;
         height: 100%;
         border: 0px;
         padding: 0px;
         position: absolute;
      }
body {
         border: 0px;
         margin: 0px;
         padding: 0px;
         height: 100%;
      }
     </style>
     <script src="http://www.openlayers.org/api/OpenLayers.js"></script>
     <script 
src="http://www.openstreetmap.org/openlayers/OpenStreetMap.js"></script>
     <script type="text/javascript">
         <!--
         // complex map object
         var map;

	// Start position for the map (hardcoded here for simplicity,
	// but maybe you want to get from URL params)
	var lat = 50.89517;
	var lon = 2.7206;
	var zoom = 10;

         function init(){
             map = new OpenLayers.Map('map',
                     { maxExtent: new 
OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34),
                       numZoomLevels: 19,
                       maxResolution: 156543.0399,
                       units: 'm',
                       projection: new OpenLayers.Projection("EPSG:900913"),
                       displayProjection: new 
OpenLayers.Projection("EPSG:4326")
                     });

             var layerMapnik = new OpenLayers.Layer.OSM.Mapnik("Mapnik");

             var layerTah = new 
OpenLayers.Layer.OSM.Osmarender("Tiles at Home");

             map.addLayers([layerMapnik,layerTah]);

             var pois = new OpenLayers.Layer.Text( "My Points",
                     { location:"./textfileukw.txt",
                       projection: map.displayProjection
                     });
             map.addLayer(pois);

             map.addControl(new OpenLayers.Control.LayerSwitcher());

             var lonLat = new OpenLayers.LonLat(lon, 
lat).transform(map.displayProjection,  map.projection);
             if (!map.getCenter()) map.setCenter (lonLat, zoom);
         }
         // -->
     </script>
   </head>
   <body onload="init()">
     <div id="map"></div>
   </body>
</html>

========++++========
lat	lon	title	description	icon	iconSize	iconOffset
50.849444951	4.347111632	bus stop	Brussel Beurs ANTOINE DANSAERTSTRAAT 
BRUSSEL-STAD BRUSSEL-STAD	Ol_icon_blue_example.png	24,24	0,-24
50.876719162	4.348477638	bus stop	Brussel Bockstael STRIJDERSSQUARE 
BRUSSEL-STAD BRUSSEL-STAD	Ol_icon_blue_example.png	24,24	0,-24
50.876476377	4.348065695	bus stop	Brussel Bockstael ÉMILE BOCKSTAELLAAN 
BRUSSEL-STAD BRUSSEL-STAD	Ol_icon_blue_example.png	24,24	0,-24
50.879613655	4.347893871	bus stop	Brussel Bockstael B ÉMILE 
BOCKSTAELLAAN BRUSSEL-STAD BRUSSEL-STAD	Ol_icon_blue_example.png	24,24	0,-24
50.879883290	4.347623779	bus stop	Brussel Bockstael B ÉMILE 
BOCKSTAELLAAN BRUSSEL-STAD BRUSSEL-STAD	Ol_icon_blue_example.png	24,24	0,-24
50.880099130	4.348163646	bus stop	Brussel Bockstael B KUNSTENAARSSTRAAT 
BRUSSEL-STAD BRUSSEL-STAD	Ol_icon_blue_example.png	24,24	0,-24
50.890569218	4.336590197	bus stop	Brussel Brugmann HOUBA DE STROOPERLAAN 
BRUSSEL-STAD BRUSSEL-STAD	Ol_icon_blue_example.png	24,24	0,-24
50.889949035	4.336903283	bus stop	Brussel Brugmann HOUBA DE STROOPERLAAN 
BRUSSEL-STAD BRUSSEL-STAD	Ol_icon_blue_example.png	24,24	0,-24
50.851107650	4.345236393	bus stop	Brussel Dansaert ANTOINE 
DANSAERTSTRAAT BRUSSEL-STAD BRUSSEL-STAD	Ol_icon_blue_example.png	24,24 
0,-24
50.851089623	4.344994990	bus stop	Brussel Dansaert ANTOINE 
DANSAERTSTRAAT BRUSSEL-STAD BRUSSEL-STAD	Ol_icon_blue_example.png	24,24 
0,-24
50.896326277	4.358035885	bus stop	Brussel De Wand DE WANDSTRAAT 
BRUSSEL-STAD BRUSSEL-STAD	Ol_icon_blue_example.png	24,24	0,-24
50.896595956	4.358007400	bus stop	Brussel De Wand DE WANDSTRAAT 
BRUSSEL-STAD BRUSSEL-STAD	Ol_icon_blue_example.png	24,24	0,-24
50.901851168	4.337634704	bus stop	Brussel Expo ROMEINSESTEENWEG 
BRUSSEL-STAD BRUSSEL-STAD	Ol_icon_blue_example.png	24,24	0,-24
50.849445374	4.349610864	bus stop	Brussel De Brouckère HALLENSTRAAT 
BRUSSEL-STAD BRUSSEL-STAD	Ol_icon_blue_example.png	24,24	0,-24
...


-- 
The "Penguin" has arrived - and he's not going away - ever.
What's on Shortwave guide: choose an hour, go!
http://shortwave dot tk
700+ Radio Stations on SW http://swstations dot tk
300+ languages on SW http://radiolanguages dot tk




More information about the Talk-be mailing list