🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: nl.comp.programmeren
1 messages
1 total messages Started by marc Wed, 30 Mar 2011 18:20
Gebruik van Openlayers: hoe aan de popups een close box geven?
#31
Author: marc
Date: Wed, 30 Mar 2011 18:20
102 lines
3991 bytes
ik heb 2 vbn
http://lijnhaltes.tk

en

http://www.dxradio.byethost14.com/research/radio/fmmaps/



Maar ik wil 1 ding: dat er een close box is aan de popups ...

de source van me ziet er zo uit:
en voor de geinteresseerden, de POIs zitten in een tab seperated:
http://www.dxradio.byethost14.com/research/radio/fmmaps/94.100/textfile.txt



%%%%%%%%%%%%%%%%%%%%%
<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 = 7;

        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@Home");

            map.addLayers([layerMapnik,layerTah]);

            var pois = new OpenLayers.Layer.Text( "My Points",
                    { location:"./textfile.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>
%%%%%%%%%%%%%%%%%% 


en daar zou ik geen boek voor willen kopen ..

http://vasir.net/openlayers_book/


-- 
--
What's on Shortwave guide: choose an hour, go!
http://shortwave.tk
700+ Radio Stations on SW http://swstations.tk
300+ languages on SW http://radiolanguages.tk
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads