PHP Classes

File: democircle.php

Recommend this page to a friend!
  Classes of Philipp Kiszka   Gmapper   democircle.php   Download  
File: democircle.php
Role: Example script
Content type: text/plain
Description: Circle drawing demo
Class: Gmapper
Present world maps with Google Maps API
Author: By
Last change:
Date: 16 years ago
Size: 1,564 bytes
 

Contents

Class file image Download
<?php
//Wir includieren die Klasse.
include("class.gmapper.php");
//Neue Instanz der Klasse erzeugen
$key = "ABQIAAAAmROoCZGDkxmdzlZMYeLCBRQesH-OtPH9W6RRY-OXCBa7C5S6exSMgJyFEkOXyPxq-mhw-VppjVttdA";
$karte = new gmap($key);
?>
<html xmlns:v="urn:schemas-microsoft-com:vml">
<head>
<?php
/*
*Wir führen im HEAD Bereich der Seite die Funktion headjs() aus.
*Sie benötigt als Argument den Google Maps API Key.
*/
$karte->headjs();
?>
</head>
<body onunload="GUnload()">
<div style="background-color:#666666;color:#FF0000;" align = "center">
Content Bevor<br>
Content Bevor<br>
Content Bevor<br>
<?php
/*
* Wir geben das HTML Element für die Karte aus. Hier wird die Karte später angezeigt.
*/
$karte->mapdiv('800', '800');
?>
Content after<br>
Content after<br>
Content after<br>
<div id = "info"></div>
</div>
<?
/*
* LETZTES BLOCKELEMENT
*Wir erzeugen eine neue Karte.
*Benötigte Parameter: initiale Zoomstufe,Breitengrad,Längengrad
*/

$karte->bodyjs();

$karte->map(6,49.980067,10.8731,"normal",0,0,"large");
//Wir fügen einige Marker hinzu
$karte->markstart();
$karte->showScale();

$karte->drawCircle(51,11.1,80,"#FF0000",2);
$karte->drawCircle(50.2,10.2,500,"#FF0000",2);
$karte->drawCircle(53,16.2,130,"#FF0CFF",3,"","#00FF00");
$karte->drawCircle(48,10,82,"#00FF44",4);
$karte->drawCircle(54,9,120,"#0036FF",4,"","#F52F2F");
$karte->drawCircle(48,8,160,"#213CA1",6,"rot.png");
$karte->mapMarker('51','11.1',"rot.png");
$karte->mapMarker('37','-122',"dash.png");

$karte->markend();
?>
</body>
</html>