Skip to content
This repository has been archived by the owner on May 6, 2021. It is now read-only.

MapStore Build and Deployment

Tobia edited this page Jan 20, 2014 · 31 revisions

These instructions describe how to build and deploy MapStore assuming you have a copy of the application source code from GitHub.

Getting a copy of the application

To get a copy of the application source code, use this command from the GIT shell:

you@prompt:~$ git clone https://github.com/geosolutions-it/mapstore.git

To initialize, build and to run the application you need Ant and Maven. In addition, to pull in external dependencies, you'll neeed Git installed. Before running in development mode or preparing the application for deployment, you need to pull in external dependencies.

Running MapStore in development mode

The MapComposer application can be run in development mode. In development mode, individual scripts are available to a debugger. To run the application in development mode, run ant debug:

you@prompt:~$ cd mapstore
you@prompt:~/mapstore$ ant debug

If the build succeeds, you'll be able to browse to the application at http://localhost:8081/. By default, the application runs on port 8081. To change this, you can set the app.port property as follows (setting the port to 9080):

you@prompt:~/mapstore$ ant -Dapp.port=9080 debug

Preparing MapStore for deployment

Preparing MapStore dependencies

MapStore needs GeoStore in order to save and organize maps. Before deploy MapStore in your servlet container, read the GeoStore build and configuration instructions here. GeoStore provide two default users:

  • admin with pw admin
  • user with pw user

If you want add new users please refer to this page of the GeoStore documentation. After the GeoStore deploy you have to run the following command from command line in order to create the 'MAP' Category for mapstore maps.

curl -u admin:admin -XPOST -H "Content-type: text/xml" -d "<Category><name>MAP</name></Category>"
http://yourhost:yourport/geostore/rest/categories

To run this command you need cURL.

You can directly download the GeoStore 1.1.1 here

MapStore needs also Http-Proxy to manage cross origin calls. Before deploying your MapStore instance, read the Http-Proxy build and configuration instructions here.

You can directly download the http_proxy 1.0.4 release here

MapStore build and deployment

The MapStore application can be run in distribution mode. In distribution mode, scripts are concatenated and minified. Before moving your application to a production environment, run ant with the "dist" target. The "dist" target will result in a directory that can be dropped in a servlet container like Apache Tomcat.

you@prompt:~$ cd mapstore
you@prompt:~/mapstore$ ant dist

After the build you will have two new directories created:

  • mapcomposer/build/mapcomposer
  • mapmanager/build/mapstore

To deploy your MapStore move the built 'mapstore' and 'mapcomposer' directories to your servlet container.

NOTE: You can build also a WAR file of 'mapstore' and 'mapcomposer' simply using the 'war' ant target instead of 'dist':

you@prompt:~$ cd mapstore
you@prompt:~/mapstore$ ant war

After the build you will have two new WAR file created:

  • mapcomposer/build/mapcomposer.war
  • mapmanager/build/mapstore.war

Configuring MapStore

MapManager configurations : go to the deployed 'mapmanager/src' directory and edit the 'config.js' file to set the own URLs (basically you have only modify the 'localhost:8080' if needed).

MapComposer configurations : go to the deployed 'mapcomposer/WEB-INF/app/static/config' directory and edit the 'mapStoreConfig.js' file to set:

  • The GeoStore URL
  • The Http-Proxy URL
  • A list of additionals URLs of WMS sources to load at startup
  • Several other configuration about layers and map configurations.
  • External plugin configuration.

For more information see the configuration page..

MapStore Sphinx documentation

The Sphinx documentation teaches you about MapStore, giving an overview of the main tools and funcionalities. This Sphinx doc is also used as a part of the MapStore training (you can find here the training material and here the related online documentation, resulting from the Sphinx's build ).

You can find the Sphinx documentation source of MapStore here. You need Sphinx installed in your system in order to build this documentation. Detailed instructions on how to install Sphinx can be found here.

Clone this wiki locally