| Conditions | 1 |
| Paths | 1 |
| Total Lines | 27 |
| Code Lines | 3 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 3 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | 2 | public function getMap($latitude, $longitude) |
|
| 9 | { |
||
| 10 | $mapDiv = " |
||
| 11 | <div id='mapdiv'></div> |
||
| 12 | <script src='http://www.openlayers.org/api/OpenLayers.js'></script> |
||
| 13 | <script> |
||
| 14 | map = new OpenLayers.Map('mapdiv'); |
||
| 15 | map.addLayer(new OpenLayers.Layer.OSM()); |
||
| 16 | |||
| 17 | 2 | var lonLat = new OpenLayers.LonLat( $longitude , $latitude ) |
|
| 18 | .transform( |
||
| 19 | new OpenLayers.Projection('EPSG:4326'), // transform from WGS 1984 |
||
| 20 | map.getProjectionObject() // to Spherical Mercator Projection |
||
| 21 | ); |
||
| 22 | |||
| 23 | var zoom=15; |
||
| 24 | |||
| 25 | var markers = new OpenLayers.Layer.Markers( 'Markers' ); |
||
| 26 | map.addLayer(markers); |
||
| 27 | |||
| 28 | markers.addMarker(new OpenLayers.Marker(lonLat)); |
||
| 29 | |||
| 30 | map.setCenter (lonLat, zoom); |
||
| 31 | </script> |
||
| 32 | "; |
||
| 33 | |||
| 34 | 2 | return $mapDiv; |
|
| 35 | } |
||
| 37 |