[OpenLayers-Users] openlayers api changed?
Milo van der Linden
milo at dogodigi.net
Wed Oct 3 12:02:42 PDT 2012
Hello Marc,
I made the following fixes to your source:
- In index.html added meta info about encoding
- set zoom to 5 (after discovering the objects where out of sight)
- Commented out the LayerTah. It doesn't seem to be available?
I had some issues converted your pasted textfile, I had to make sure all
spaces where correct and I found out that the 3th column containing
'21500Mhz' was not mapped resulting in OpenLayers unable to find the png's
Please find attached a working copy of your sample.
Kind regards,
Milo van der Linden
2012/10/3 Marc Coevoet <marcc at dommel.be>
>
> Hello,
>
> 3 years ago, I made a openlayers app with radio frequencies for FM and
> adjacent stations that could give noise.
>
> I see that suddenly the app no longer works.
>
> I will copy the code here:
> (images are on the right place ..)
>
> index.htm:
> ====
> <html xmlns="http://www.w3.org/1999/**xhtml <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<http://www.openlayers.org/api/OpenLayers.js>
> "></**script>
> <script src="http://www.openstreetmap.**org/openlayers/OpenStreetMap.*
> *js <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 at 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>
> ===
>
> The textfile.txt starts like this :
> lat lon title description icon iconSize iconOffset
> 57.28528 10.10139 91.500MHz Broenderslev
> above sea 40m antenna height 40m erp h/v 22.0dBm/ dBm pol/dir /
> ../antenne.png 40,40 -20,-20
> 46.26750 10.11778 91.500MHz Brusio
> above sea 1097m antenna height 50m erp h/v 20.0dBm/ dBm pol/dir /
> ../antenne.png 40,40 -20,-20
> 51.80139 10.61694 91.500MHz Brocken
> above sea 1140m antenna height 65m erp h/v 50.0dBm/ dBm pol/dir /
> ../antenne.png 40,40 -20,-20
> 53.74444 10.70583 91.500MHz Berkenthin
> above sea 65m antenna height 147m erp h/v 30.0dBm/ dBm pol/dir /
> ../antenne.png 40,40 -20,-20
> 48.90222 11.16306 91.500MHz Eichstaett
> above sea 470m antenna height 30m erp h/v 20.0dBm/ dBm pol/dir /
> ../antenne.png 40,40 -20,-20
> 46.40083 11.28472 91.500MHz Bolzano Montic
> above sea 638m antenna height 97m erp h/v 30.0dBm/ dBm pol/dir /
> ../antenne.png 40,40 -20,-20
> ...
>
>
>
> Where could te problem be?
>
> The fiels are uploaded to
> http://dxradio.woelmuis.nl/**research/fmmaps/<http://dxradio.woelmuis.nl/research/fmmaps/>
> (and the pub does'nt make a problem)
>
> Marc
> --
> 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
> ______________________________**_________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/**mailman/listinfo/openlayers-**users<http://lists.osgeo.org/mailman/listinfo/openlayers-users>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20121003/8faa3a12/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: marccoevoet.zip
Type: application/zip
Size: 3680 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20121003/8faa3a12/attachment.zip>
More information about the Users
mailing list