[go: up one dir, main page]

Menu

[r4]: / omgm / index.php  Maximize  Restore  History

Download this file

76 lines (65 with data), 3.0 kB

 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?
include_once("define.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>OMGM - Orienteering Maps in Google Map</title>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" />
<link href="resources/main.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="navigation">
<?
include "menu.inc";
?>
</div>
<h1>Orienteering Maps in Google Map</h1>
<p>
When developing Google Map applications for showing orienteering courses or
GPS tracks from orienteering events, the experience would be much better if you
had orienteering maps in Google Map...
</p>
<p>
And now OMGM have come to rescue! OMGM allows you to upload
orienteering maps and use them in your Google Map application. OMGM provide a
&quot;orienteering map tile layer&quot; for all uploaded maps.
</p>
<h2>How to use OMGM?</h2>
<p>
Include following JavaScript code in your Google Map application to enable it to use OMGM.
</p>
<pre>
var map = new GMap2(document.getElementById("map_canvas"));
...
var omgmCopyright = new GCopyrightCollection('OMGM (C)');
var omgmBounds = new GLatLngBounds(new GLatLng(-90,-180), new GLatLng(90,180));
omgmCopyright.addCopyright(new GCopyright('OMGM', omgmBounds, 8, 'Various map producers'));
var omgmTilelayer = new GTileLayer(omgmCopyright, 8, 16);
omgmTilelayer.getTileUrl = function(point, zoom) {
var url = '<? echo OMGMURL?>/tile.php?x='+point.x+'&y='+point.y+'&zoom='+zoom;
return url;
};
omgmTilelayer.isPng = function() { return true; };
omgmTilelayer.getOpacity = function() { return 1.0; }
// Orienteering maps over normal map
var omgmTileLayersNormal = [G_NORMAL_MAP.getTileLayers()[0], omgmTilelayer];
// Orienteering maps over satellite map
var omgmTileLayersSat = [G_SATELLITE_MAP.getTileLayers()[0], omgmTilelayer];
var omgmMapNormal = new GMapType(omgmTileLayersNormal, new GMercatorProjection(20), "O Maps over normal map", {errorMessage: "No data available"});
var omgmMapSat = new GMapType(omgmTileLayersSat, new GMercatorProjection(20), "O Maps over satellite map", {errorMessage: "No data available"});
map.addControl(new GMapTypeControl());
map.addMapType(omgmMapNormal);
map.addMapType(omgmMapSat);
// Now you should see new Map Type controls (with names "O Maps over normal map" and "O Maps over satellite map" besides the ordinary Map Type controls)
// If you always want orienteering maps on Google Map. Then you skip map.addMapType(omgmMapNormal); map.addMapType(omgmMapSat); above and add following
//var omgmTileOverlay = new GTileLayerOverlay(omgmTilelayer);
//map.addOverlay(omgmTileOverlay);
...
</pre>
<h2>Copyright</h2>
<p>
Maps are often protected by copyright, respect this and don't upload anything without approval.
</p>
</body>
</html>