[ka-Map-users] Google map with Map server

Hajime TANAKA hajime.tanaka at tufts.edu
Tue Dec 29 13:32:49 EST 2009


Hi, Gaurav

As Stephen explained, you cannot have Google in Ka-map, but at least
you can set your PROJECTION
the same as google's. After this, you can overlay ka-map on google
with OpenLayers, this has good performance I think.

I had a hard time to do overlay Ka-map with google, too, then let me
explain a bit.

The questions are
1. What is Google's projection?
2. How are layers' projections defined in mapfile?
3. Which is the file which express the concrete equation of
projections in your Computer?

Google uses "Spherical Mercator".
You will find that you need to set your mapfile PROJECTION as "init:epsg=900913"
Change the UNIT as well if your UNIT is DD(Decimal Degree).

run shp2img to test your mapfile.

Then I suppose that your mapserv will say you don't have the projection.

Google the correct "proj" statement of epsg:900913.
and add it to the "epsg" file.

In this way at least Ka-map's projection will be the same as google's.
Stretched to North and South compared to the ordinary WGS84,
coordinates are mercator.

Don't forget to set each layers projection as well.

After this, Overlay with OpenLayers will work without shift, but I
guess you still have problems with scales.

Good luck.

Hajime

2009/12/29 Stephen Woodbridge <woodbri at swoodbridge.com>:
> Gaurav Thakur wrote:
>> hi all i m new with mapserver
>>
>> can anyone help me how to use google maps as a layer in my map file
>> and show with other shapefile layers on a single map
>
> You can not do that the way you mentioned.
> But you can use OpenLayers to display Google maps as a base layer and
> then use mapserver to overlay you shapefile on that base layer.
>
> See http://openlayers.org/ and look at the samples or examples.
>
> -Steve
> _______________________________________________
> ka-Map-users mailing list
> ka-Map-users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/ka-map-users
>



-- 
Hajime Tanaka


More information about the ka-Map-users mailing list