Are there things that can be done with MapScript and not Map file or vice versa? What are the scenarios to use each one?


Mapfiles are good for making standard WMS, WFS and WCS services. They are mostly stable even some limited set of the mapfile parameters can be changed on-the-fly by using the variable substitution mechanism. Static mapfiles are enough for serving data to GIS clients like ArcGIS, QGIS, OpenJUMP etc. and also for browser applications made with OpenLayers or Leaflet if there is not big need for user interaction.

MapScript is not an alternative for mapfiles but it is a scripting language for controlling functions which are supported by Mapserver. MapScript can for example offer users a possibility to change the mapfile parameters on-the-fly and control how the rendered map looks like but it can be used to much more. See for example what p.mapper can do http://pmapper.net/.

I believe that applications which utilize MapScript are not very common nowadays because javascript is so popular and there are not many people who know or are willing to learn MapScript.

| improve this answer | |
  • hey! thanks allot for the answer! i think i got it: when allot of interactivity is required, the use of mapscript will be inevitable? how does javascript replaces mapscript? – dowi Jun 24 '14 at 15:02
  • You can use javascript on the client side but as far as I know you cannot control Mapserver with it. Some limited control is possible with variable substitution but not full control. You have certainly read mapserver.org/mapscript/index.html? – user30184 Jun 24 '14 at 20:44
  • You can also use mapscript to inject content into your getcapabilities response, for example to add extra metadata – nmtoken Dec 2 '16 at 11:02

Found a good overview course here: Pluralsight course on mapserver mapscript and gdal

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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