Login   Register  
PHP Classes

File: ex8.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Vagharshak Tozalakyan  >  Map Builder  >  ex8.php  >  Download  
File: ex8.php
Role: Example script
Content type: text/plain
Description: Example 8 - Filling data from database.
Class: Map Builder
Display maps using Google Maps API v3
Author: By
Last change: typo fix
Date: 1 year ago
Size: 955 bytes


Class file image Download

// Include MapBuilder class.
require_once 'class.MapBuilder.php';

// Create MapBuilder object.
$map = new MapBuilder();

// Set map's center position by latitude and longitude coordinates. 

// Set the default map type.

// Set width and height of the map.

// Set default zoom level.

// Connect the database.
mysql_connect('localhost''root''') or die('Unable to connect the database!');
mysql_select_db('map_data') or die('Unable to select the database!');

// Select data and add markers using that data.
$result mysql_query("SELECT name, lat, lng FROM highlights") or die(mysql_error());
while (
$row mysql_fetch_assoc($result)) {
$map->addMarker($row['lat'], $row['lng'], array(
'title' => $row['name'

// Display the map.