-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathREADME
47 lines (30 loc) · 1.06 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Nepal Map API
=============
PHP API to generate Nepal's map with options to highlight districts.
See example.php for usage example. Demo at http://jwalanta.com/nepalmapapi
Usage
------
<?
// Include the library and create object:
include("nepalmap.php");
$map = new NepalMap();
// Set options:
// set image width
$map->setWidth(1000);
// set stroke color array(r,g,b) and width
$map->setStroke(array(0,0,0), 2);
// set fill color for districts
// array format "district_name"=>array(r,g,b)
$map->setDistrictFillColor(array("kathmandu"=>array(255,0,0),
"lalitpur"=>array(100,0,0)));
// generate map!
$map->generateMap(); // sends to browser
// or,
$map->generateMap("/path/to/file.png"); // saves as file
?>
Other Options
--------------
getImageWidth(), getImageHeight()
- Returns maps width and height
htmlAreaCode()
- Returns <area> html code to be used with <map>. See maphilight (http://plugins.jquery.com/project/maphilight) or mapper.js (http://www.netzgesta.de/mapper/) on using this data.