|
18 | 18 | Introduction |
19 | 19 | ============ |
20 | 20 |
|
21 | | -The term 'map context' comes from the Open Geospatial Constortium's (OGC) `Web |
| 21 | +The term 'map context' comes from the Open Geospatial Consortium's (OGC) `Web |
22 | 22 | Map Context Specification v1.0.0`_, which coincides with the OGC `Web Map |
23 | 23 | Server Specification (WMS) v1.1.1`_. A map context is a XML document that |
24 | 24 | describes the appearance of layers from one or more WMS servers, and can be |
@@ -385,103 +385,7 @@ Map Context Support Through CGI |
385 | 385 | ------------------------------- |
386 | 386 |
|
387 | 387 | MapServer CGI allows you to load a map context through the use of a CONTEXT |
388 | | -parameter, and you can point this parameter to a locally stored context file |
389 | | -or a context file accessible through a URL. For more information on MapServer |
390 | | -CGI see the :ref:`CGI Reference <cgi>`. |
391 | | - |
392 | | -Support for Local Map Context Files |
393 | | -*********************************** |
394 | | - |
395 | | -There is a new cgi parameter called *CONTEXT* that is used to specify a local |
396 | | -context file. The user can then use MapServer to request a map using the |
397 | | -following syntax: |
398 | | - |
399 | | -:: |
400 | | - |
401 | | - http://localhost/mapserver.cgi?MODE=map&MAP=/path/to/mapfile.map&CONTEXT= |
402 | | - /path/to/contextfile.xml&LAYERS=layer_name1 layers_name2 |
403 | | - |
404 | | -.. note:: |
405 | | - |
406 | | - All layers created from a context file have their status set to ON. To be |
407 | | - able to display layers, the user needs to add the LAYERS argument in the |
408 | | - URL. |
409 | | - |
410 | | -Support for Context Files Accessed Through a URL |
411 | | -************************************************ |
412 | | - |
413 | | -The syntax of using a web accessible context file would be similar to accessing |
414 | | -a local context file: |
415 | | - |
416 | | -:: |
417 | | - |
418 | | - http://localhost/mapserver.cgi?MODE=map&MAP=/path/to/mapfile.map&CONTEXT= |
419 | | - http://URL/path/to/contextfile.xml&LAYERS=layers_name1 layer_name2 |
420 | | - |
421 | | -Due to security concerns loading a file from a URL is disabled by default. To enable |
422 | | -this functionality, the user needs to set a CONFIG parameter called *CGI_CONTEXT_URL* |
423 | | -in the default mapfile that will allow this functionality. Here is an example of a |
424 | | -map file with the CONFIG parameter: |
425 | | - |
426 | | -.. code-block:: mapfile |
427 | | - |
428 | | - # Start of map file |
429 | | - NAME "map-context" |
430 | | - STATUS ON |
431 | | - SIZE 400 300 |
432 | | - EXTENT -2200000 -712631 3072800 3840000 |
433 | | - UNITS METERS |
434 | | - IMAGECOLOR 255 255 255 |
435 | | - IMAGETYPE png |
436 | | - CONFIG "CGI_CONTEXT_URL" "1" |
437 | | - ... |
438 | | - WEB |
439 | | - ... |
440 | | - END |
441 | | - LAYER |
442 | | - ... |
443 | | - END |
444 | | - |
445 | | - END |
446 | | - |
447 | | -Default Mapfile |
448 | | -**************** |
449 | | - |
450 | | -To smoothly run a MapServer CGI application with a Map Context, the |
451 | | -application administrator needs to provide a default mapfile with at least the |
452 | | -basic required parameters that will be used with the Context file. This |
453 | | -default mapfile can contain as little information as the imagepath and |
454 | | -imageurl or contain a list of layers. Information coming from the context |
455 | | -(e.g.: layers, width, height, ...) would either be appended or will replace |
456 | | -values found in the mapfile. |
457 | | - |
458 | | -Here is an example of a default map file containing the minimum required |
459 | | -parameters: |
460 | | - |
461 | | -.. code-block:: mapfile |
462 | | - :linenos: |
463 | | - |
464 | | - NAME "CGI-CONTEXT-DEMO" |
465 | | - STATUS ON |
466 | | - SIZE 400 300 |
467 | | - EXTENT -2200000 -712631 3072800 3840000 |
468 | | - UNITS METERS |
469 | | - IMAGECOLOR 255 255 255 |
470 | | - IMAGETYPE png |
471 | | - # |
472 | | - # Start of web interface definition |
473 | | - # |
474 | | - WEB |
475 | | - MINSCALE 2000000 |
476 | | - MAXSCALE 50000000 |
477 | | - # |
478 | | - # On Windows systems, /tmp and /tmp/ms_tmp/ should be created at the root |
479 | | - # of the drive where the .MAP file resides. |
480 | | - # |
481 | | - IMAGEPATH "/ms4w/tmp/ms_tmp/" |
482 | | - IMAGEURL "/ms_tmp/" |
483 | | - END |
484 | | - END # Map File |
| 388 | +parameter. See :ref:`mapcontext_cgi` for details. |
485 | 389 |
|
486 | 390 | Map Context Support Through WMS |
487 | 391 | ------------------------------- |
|
0 commit comments