OpenLayers OpenLayers

Changeset 5381

Show
Ignore:
Timestamp:
12/12/07 02:57:48 (1 year ago)
Author:
CloudAmber
Message:

Now uses WGS84 & Google Maps.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sandbox/CloudAmber/Trunk/GooglePopups.htm

    r4178 r5381  
    66    <link href="map.css" rel="stylesheet" type="text/css" /> 
    77 
    8     <script type="text/javascript" src="http://api.maps.yahoo.com/ajaxymap?v=3.0&appid=euzuro-openlayers"></script> 
     8    <!--trac--> 
     9    <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAiL5fH4uW-yV8VTcbOVPBRhQxeKV6F6Ky7QnUoAy-KzxCQKB-PBQY9zocwPGzqaL7UtwFZdcP3uNgmw" type="text/javascript"></script> 
     10 
     11    <!--localhost--> 
     12    <!--<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAiL5fH4uW-yV8VTcbOVPBRhT2yXp_ZAY8_ufC3CFXhHIE1NvwkxSM77ok_15xYCWhpsc3DaKZB-rsUQ" type="text/javascript"></script>--> 
    913 
    1014    <script type="text/javascript" src="script/OpenLayers.js"></script> 
     
    2428        var zoom = null; 
    2529 
     30        OpenLayers.Layer.Google.prototype.addContainerPxFunction=function() { 
     31            if (typeof GMap2 != "undefined" && !GMap2.prototype.fromLatLngToContainerPixel) { 
     32                
     33                GMap2.prototype.fromLatLngToContainerPixel = function(gLatLng) { 
     34                 
     35                    // first we translate into "DivPixel" 
     36                    var gPoint = this.fromLatLngToDivPixel(gLatLng); 
     37                         
     38                    // locate the sliding "Div" div 
     39                    var div = this.getContainer().firstChild.firstChild; 
     40                         
     41                    // adjust by the offset of "Div" and voila! 
     42                    gPoint.x += div.offsetLeft; 
     43                    gPoint.y += div.offsetTop; 
     44                     
     45                    return gPoint; 
     46                };   
     47            }    
     48        };   
     49 
    2650        // Create map 
    27         //map = new OpenLayers.Map( 'map', {controls: [], tileSize: new OpenLayers.Size(256,256), numZoomLevels: 18, controls: [new OpenLayers.Control.MouseDefaults()] } ); 
    28         map = new OpenLayers.Map( 'map', {maxExtent: new OpenLayers.Bounds(0,0,700000,1100000), 'maxResolution': 1000, controls: [], tileSize: new OpenLayers.Size(256,256), numZoomLevels: 12, controls: [new OpenLayers.Control.MouseDefaults()] } ); 
     51        map = new OpenLayers.Map( 'map', {controls: [], tileSize: new OpenLayers.Size(256,256), numZoomLevels: 18, controls: [new OpenLayers.Control.MouseDefaults()] } ); 
    2952     
    3053        // Add some image layers 
    31         //map.addLayer(new OpenLayers.Layer.Yahoo("Yahoo"));  
    32         map.addLayer(new OpenLayers.Layer.WMS("Map", "http://models.itoworld.com/map/wms", {'layers': 'vwa,vpa,via,r,rw,vlb', 'srs': 'EPSG:27700', 'format': 'image/png', 'transparent': 'false'})); 
     54        map.addLayer(new OpenLayers.Layer.Google("Google", {"sphericalMercator": true}));  
    3355 
    3456        // Add some popups layers 
     
    4264 
    4365        // Centre map 
    44         lon = 425000
    45         lat = 415000
    46         zoom = 3
     66        lon = -0.064958
     67        lat = 51.612671
     68        zoom = 12
    4769        map.setCenter(new OpenLayers.LonLat(lon, lat), zoom); 
    4870 
     
    6991        script. Simply include this and the images in <a href="script/img">script/img</a>, 
    7092        replicate out the tweaks in the <a href="map.css">map.css</a> and you should be 
    71         up and running. Dont worry about the co-ordinates, they are in OS-GB but the site will work perfectly with WGS-84. Also, dont forget to add a few CR LF to the end of the .txt files, OpenLayers doesnt read the last line. 
     93        up and running. Dont forget to add a few CR LF to the end of the .txt files, OpenLayers doesnt read the last line. 
    7294    </p> 
    7395    <p> 
     
    79101        This has been developed for <a href="http://www.ukvoyager.info">http://www.ukvoyager.info</a> 
    80102        by <a href="http://www.cloudamber.com">Cloud Amber</a>. The page driving the site 
    81         can be found at <a href="http://www.ukvoyager.info/pages/map/currentmap.aspx">http://www.ukvoyager.info/pages/map/currentmap.aspx</a>. 
     103        can be found at <a href="http://www.ukvoyager.info/myMap.aspx">http://www.ukvoyager.info/myMap.aspx</a>. 
    82104        For more information <a href="http://www.cloudamber.com/Contact.aspx">contact us here</a>.</p> 
    83105    <img src="http://www.ukvoyager.info/images/PoweredByCloudAmber.png" alt="Powered By Cloud Amber" /> 
  • sandbox/CloudAmber/Trunk/txt/carparks.txt

    r4031 r5381  
    11point   title   description icon    iconSize 
    2 421747,404385 South Yorkshire - Rockley Avenue closed both....    <table width="250px"><tr><td>Expected delay:</td><td>Unknown Severity</td></tr><tr><td>Start:</td><td>08/Jun 13:47</td></tr><tr><td>End:</td><td>24/Jun 20:00</td></tr></table><br> icons/carpark.png   28,26 
     251.605273,-0.096465   South Yorkshire - Rockley Avenue closed both....    <table width="250px"><tr><td>Expected delay:</td><td>Unknown Severity</td></tr><tr><td>Start:</td><td>08/Jun 13:47</td></tr><tr><td>End:</td><td>24/Jun 20:00</td></tr></table><br> icons/carpark.png   28,26 
    33 
    44 
  • sandbox/CloudAmber/Trunk/txt/incidents.txt

    r4031 r5381  
    11point   title   description icon    iconSize    iconOffset 
    2 432500,415000 M18 South Yorkshire - Accident southbound at....    <table width="400px" border="0" cellpadding="0" cellspacing="0"><tbody><tr><td rowspan="3" style="text-align:center;"><img width="69" height="61" src="icons/incidentBig.png" alt="Access Icon" /></td><td>Traffic Disruption @ 22/Jun 14:55</td></tr><tr><td><b>Severe</b> disruption expected.<br /></td></tr><tr><td><a title="Zoom out to overview" href="javascript:map.zoomOut();">Zoom out</a> &middot; <a title="Zoom in for closer view" href="javascript:map.zoomIn();">Zoom in</a></td></tr></tbody></table> icons/incident.png  33,30 
    3 401747,434385 South Yorkshire - Rockley Avenue closed both....    <table width="250px"><tr><td>Expected delay:</td><td>Unknown Severity</td></tr><tr><td>Start:</td><td>08/Jun 13:47</td></tr><tr><td>End:</td><td>24/Jun 20:00</td></tr></table> icons/incident.png  33,30 
     251.591927,-0.072192   M18 South Yorkshire - Accident southbound at....    <table width="400px" border="0" cellpadding="0" cellspacing="0"><tbody><tr><td rowspan="3" style="text-align:center;"><img width="69" height="61" src="icons/incidentBig.png" alt="Access Icon" /></td><td>Traffic Disruption @ 22/Jun 14:55</td></tr><tr><td><b>Severe</b> disruption expected.<br /></td></tr><tr><td><a title="Zoom out to overview" href="javascript:map.zoomOut();">Zoom out</a> &middot; <a title="Zoom in for closer view" href="javascript:map.zoomIn();">Zoom in</a></td></tr></tbody></table> icons/incident.png  33,30 
     351.607998,-0.065156   South Yorkshire - Rockley Avenue closed both....    <table width="250px"><tr><td>Expected delay:</td><td>Unknown Severity</td></tr><tr><td>Start:</td><td>08/Jun 13:47</td></tr><tr><td>End:</td><td>24/Jun 20:00</td></tr></table> icons/incident.png  33,30 
    44 
    55 
  • sandbox/CloudAmber/Trunk/txt/roadworks.txt

    r4031 r5381  
    11point   title   description icon    iconSize 
    2 432500,430000 M18 South Yorkshire - Accident southbound at....    <table width="400px" border="0" cellpadding="5" cellspacing="5"><tbody><tr><td><img width="71" height="65" src="icons/roadworkBig.png" alt="Roadwords Germany A9"/></td><td>Traffic Disruption @ 22/Jun 14:55<br/><b>Severe</b> disruption expected.<br/><br/>Courtesy of <a href="http://www.cloudamber.com">www.cloudamber.com</a></td></tr></tbody></table>  icons/roadwork.png  33,30 
    3 445050,440000 M18 South Yorkshire - Accident southbound at....    <table width="400px" border="0" cellpadding="0" cellspacing="0"><tbody><tr><td><img width="71" height="65" src="icons/roadworkBig.png" alt="Access Icon"/></td><td>Traffic Disruption @ 22/Jun 14:55<br/><b>Severe</b> disruption expected.<br/><br/>Courtesy of <a href="http://www.cloudamber.com">www.cloudamber.com</a></td></tr></tbody></table>   icons/roadwork.png  33,30 
     251.606528,-0.107388   M18 South Yorkshire - Accident southbound at....    <table width="400px" border="0" cellpadding="5" cellspacing="5"><tbody><tr><td><img width="71" height="65" src="icons/roadworkBig.png" alt="Roadwords Germany A9"/></td><td>Traffic Disruption @ 22/Jun 14:55<br/><b>Severe</b> disruption expected.<br/><br/>Courtesy of <a href="http://www.cloudamber.com">www.cloudamber.com</a></td></tr></tbody></table>  icons/roadwork.png  33,30 
     351.587380,-0.036584   M18 South Yorkshire - Accident southbound at....    <table width="400px" border="0" cellpadding="0" cellspacing="0"><tbody><tr><td><img width="71" height="65" src="icons/roadworkBig.png" alt="Access Icon"/></td><td>Traffic Disruption @ 22/Jun 14:55<br/><b>Severe</b> disruption expected.<br/><br/>Courtesy of <a href="http://www.cloudamber.com">www.cloudamber.com</a></td></tr></tbody></table>   icons/roadwork.png  33,30 
    44 
    55 
  • sandbox/CloudAmber/Trunk/txt/speedCameras.txt

    r4031 r5381  
    11point   title   description icon    iconSize 
    2 391747,404385 Embedded Video Example (Matrix - MTV Rip)   <object width="375" height="300"><param name="movie" value="http://www.youtube.com/v/58_E03ecx4E"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/58_E03ecx4E" type="application/x-shockwave-flash" wmode="transparent"  width="375" height="300"></embed></object>    icons/speedcamera.png   24,20 
    3 390000,424385 Embedded Video Example (Happy Track)    <embed style="width:400px; height:326px;" id="VideoPlayback" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docId=1811233136844420765&hl=en-GB" flashvars=""> </embed>  icons/speedcamera.png   24,20 
     251.621255,-0.040322   Embedded Video Example (Matrix - MTV Rip)   <object width="375" height="300"><param name="movie" value="http://www.youtube.com/v/58_E03ecx4E"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/58_E03ecx4E" type="application/x-shockwave-flash" wmode="transparent"  width="375" height="300"></embed></object>    icons/speedcamera.png   24,20 
     351.618788,-0.021938   Embedded Video Example (Happy Track)    <embed style="width:400px; height:326px;" id="VideoPlayback" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docId=1811233136844420765&hl=en-GB" flashvars=""> </embed>  icons/speedcamera.png   24,20 
    44 
    55