Location: PHPKode > projects > Kwalbum > kwalbum/pages/AdminLocationsMapPage.php
<?php
/**
 * @version 2.1.2
 * @since 2.1.2
 * @package kwalbum
 */
require_once 'include/IPage.php';

class AdminLocationsMapPage implements IPage
{
	function GetHead(& $title)
	{
		if (false == USER_IS_ADMIN)
			return;

		$title = 'Change Location Values';
		return <<<END_HEAD
    <style type="text/css">
#map {
        width: 80%;
        height: 90%;
        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 src="ajax/map/bounds.js"></script>
    <script src="ajax/map/MarkerGrid.js"></script>
    <script src="ajax/map/MarkerTile.js"></script>
    <script type="text/javascript">
        <!--
        var map;

        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 (updated weekly)");

            var layerTah = new OpenLayers.Layer.OSM.Osmarender("hide@address.com");

            map.addLayers([layerMapnik,layerTah]);

		    // create POI layer
		    var locationPOI = new OpenLayers.Layer.MarkerGrid( "Locations",
			{
				type:'txt',
				getURL: get_location_poi_url,
				buffer: 0
			});
			locationPOI.setIsBaseLayer(false);
			locationPOI.setVisibility(true);

		    var itemPOI = new OpenLayers.Layer.MarkerGrid( "Items",
			{
				type:'txt',
				getURL: get_item_poi_url,
				attribution: "Kwalbum",
				buffer: 0
			});
			itemPOI.setIsBaseLayer(false);
			itemPOI.setVisibility(true);

	        map.addLayer(locationPOI);
	        map.addLayer(itemPOI);

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

	        var center = new OpenLayers.LonLat(-30, 30).transform(map.displayProjection,  map.projection);
	        map.setCenter (center, 2);
        }

        function get_item_poi_url(bounds) {
            var z = this.map.getZoom();
            var path = "?z=" + z
            + "&l=" + getLeft(bounds)
            + "&t=" + getTop(bounds)
            + "&r=" + getRight(bounds)
            + "&b=" + getBottom(bounds)
            + "&i=1";
            //alert url+path);
            var url = "ajax/map/index.php";
            return url + path;
        }

        function get_location_poi_url(bounds) {
            var z = this.map.getZoom();
            var path = "?z=" + z
            + "&l=" + getLeft(bounds)
            + "&t=" + getTop(bounds)
            + "&r=" + getRight(bounds)
            + "&b=" + getBottom(bounds)
            + "&i=0";
            var url = "ajax/map/index.php";
            return url + path;
        }
        // -->
    </script>
END_HEAD;
	}

	function ShowBody()
	{
		if (0 == USER_ID)
			return;
		global $URLP, $DB;
		$query = 'SELECT LocationId, Location FROM '.LOCATION_TABLE.
		" ORDER BY Location ASC";
		$result = $DB->Query($query);
		require 'AdminLocationsMapPage.html.php';
	}
}
?>
Return current item: Kwalbum