0

I am new to MapServer and I wanted to host offline map server on Windows, so after following this link https://github.com/mapserver/mapserver/wiki/RenderingOsmDataWindows#osm-import I have setup the map for only India.

and with the below URL I can get a map of India, but I can't zoom in. How can I get to a particular lat long at center with some zoom value using URL parameters?

http://localhost/cgi-bin/mapserv.exe?mode=browse&template=openlayers&layers=all&map=C:/ms4w/apps/osm/basemaps/osm-google.map

1 Answer 1

1

Check out the mapserver doc page: https://mapserver.org/ogc/wms_server.html

Specifically the bbox parameter:

BBOX=minx,miny,maxx,maxy

seen here in a url (copied from docs):

http://my.host.com/cgi-bin/mapserv?map=mywms.map&SERVICE=WMS&VERSION=1.1.1
 &REQUEST=GetMap&LAYERS=prov_bound&STYLES=&SRS=EPSG:4326
 &BBOX=-173.537,35.8775,-11.9603,83.8009&WIDTH=400&HEIGHT=300
 &FORMAT=image/png

The BBOX is the geographic rectangle you want(note the center is the middle of the bbox) to be included in your map. How you actually get the bbox manually is up to you...usually a tool like openlayers or leaflet keeps track for you.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.