[mapserver-users] Mapserver and Google-earth

Murat Beyhan beyhan at deprem.gov.tr
Wed May 30 06:02:45 PDT 2012


Dear friend,
I'm using mapserver for drawing some maps for long time.
Ireally interested in to draw layer on the google-earth nowadays.


<!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">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Google/MapServer Tile Example</title>
<script
src="http://maps.google.com/maps?file=api&v=2&key=AIzaSyA0L5EpH3B3DGV6kaRWBBOwYa6SY8jPJDk"
        type="text/javascript"></script>
<script type="text/javascript">

function load() {
  if (GBrowserIsCompatible()) {
    var urlTemplate = 'http://localhost/cgi-bin/mapserv?';
        urlTemplate += 'map=/var/map.map&';
        urlTemplate += 'layers=layer1 layer2&';
        urlTemplate += 'mode=tile&';
        urlTemplate += 'tilemode=gmap&';
        urlTemplate += 'tile={X}+{Y}+{Z}';
    var myLayer = new GTileLayer(null,0,18,{
                                 tileUrlTemplate:urlTemplate,
                                 isPng:true,
                                 opacity:0.3 });
    var map = new GMap2(document.getElementById("map"));
    map.addControl(new GLargeMapControl());
    map.addControl(new GMapTypeControl());
    map.setCenter(new GLatLng(36.5, 36.00), 9);
    var myMapType = new GMapType([myLayer], new GMercatorProjection(18),
'MapServer');
    map.addMapType(myMapType);
  }
}

</script>
</head>
<body onload="load()" onunload="GUnload()">
  <div id="map" style="width: 1500px; height: 1500px"></div>
</body>
</html>


with this example I draw map using google-earth . But I would like to
draw some points stored in MySQL database or/and shape files. Please
give an advice where should I should study to learn to combine mapserver
and google -earth api together. Thanks for your help. İf you send an
example map file and template file it will be help-full...
Regards...



-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



More information about the mapserver-users mailing list