Google maps as a Mapserver interface

Kyle Mulka kmulka at GLC.ORG
Fri Jul 15 10:35:43 EDT 2005


I don't know if anyone has pointed this out yet, but there is an opensource
javascript API that looked very similar to Google Maps. I haven't looked
into the details though, and don't really know what you are looking for, but
here it is:
http://ka-map.maptools.org/

-Kyle Mulka
http://www.kylemulka.com 

-----Original Message-----
From: Antti Roppola [mailto:ajr at BRS.GOV.AU] 
Sent: Thursday, July 14, 2005 1:19 AM
Subject: Google maps as a Mapserver interface

Hi all,

Has anybody looked at using Google maps as a UI for Mapserver or WMS? I had
a look through the API and ended up re-purposing the marker PNG sice there
was no apparent way of importing base layers different to those Google
provides.

I'll post a URL once I start experimentally serving some data in the same
projection as Google's base and fix up a few warts in the example, i.e. it
Currently doesn't clean up after itself or handle zoom events properly.

WFS ought to be a case of an XSLT to munge features into Google's format.

Cheers,

Antti


var map = new GMap(document.getElementById("map"));
map.addControl(new GSmallMapControl());
map.centerAndZoom(new GPoint(139.2, -34), 9); function importMS() {
  map.removeOverlay(marker);
  var bounds = map.getBoundsLatLng();
  var myxmax = bounds.maxX;
  var myymax = bounds.maxY;
  var myxmin = bounds.minX;
  var myymin = bounds.minY;
  var myext = '&mapext=' + myxmin + '+' + myymin + '+' + myxmax + '+' +
myymax;

  var icon = new GIcon();
  var mapserv = 'http://www.some.mapserv/url' + myext;
  var markershadurl
= "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
  icon.image = mapserv;
  icon.shadow = markershadurl;
  icon.iconSize = new GSize(500,400);
  icon.shadowSize = new GSize(22,20);
  icon.iconAnchor = new GPoint(250,200);
  icon.infoWindowAnchor = new GPoint(5,1);

  var marker = new GMarker(new GPoint((myxmin + ((myxmax - myxmin)/2)),
(myymax - ((myymax - myymin)/2))), icon);
  map.addOverlay(marker);
}
importMS();

GEvent.addListener(map, "moveend", function() {
  importMS();
});



More information about the mapserver-users mailing list