Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Info: What is LiteMap and how it can be configured?

LiteMap is a lightweight iShare map that has been designed to be able to be integrated directly into other web applications.

To successfully integrate a LiteMap in a web application or to build a standalone LiteMap you need to include the LiteMap’s JavaScript and CSS files in your HTML page via Astun Services. The files you need to point to are the following:

  1. LiteMap JS module

  2. LiteMap CSS styles

Also, additional configuration is needed based on LiteMap ol-ishare module.

Step-by-step guide

  1. Set up an HTML file and include the JavaScript and CSS files

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, user-scalable=no initial-scale=1.0">
        <title>LiteMap - Example guide</title>
        <link rel="stylesheet" href="https://ol-ishare.services.astuntechnology.com/v1/apps/lite/lite.css">
    </head>
    <body>
        <script src="https://ol-ishare.services.astuntechnology.com/v1/apps/lite/lite.js"></script>
    </body>
    </html>
  2. Create a basic styling and a map element that will hold your map.

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, user-scalable=no initial-scale=1.0">
        <title>LiteMap - Example guide</title>
        <link rel="stylesheet" href="https://ol-ishare.services.astuntechnology.com/v1/apps/lite/lite.css">
        <style type="text/css">
            html,
            body {
                height: 100%;
                padding: 0;
                margin: 0;
                font-family: sans-serif;
                font-size: small;
            }
    
            #map {
                width: 100%;
                height: 100%;
            }
        </style>
    </head>
    <body>
        <div id="map"></div>
        <script src="https://ol-ishare.services.astuntechnology.com/v1/apps/lite/lite.js"></script>
    </body>
    </html>
  3. Configure and load your map with the layers you desire. Add a new script element below the script where you point to the LiteMap JS file and create a new LiteMap with the following options as indicated in the documentation πŸ“– :

    • target πŸ‘‰ the id of an element on the page in which the map will be created (in this case the map element

    • iShareUrl πŸ‘‰ the iShare Maps server to load data from (in this case the Astun Technology demo server)

    • profile πŸ‘‰ the iShare profile (also known as a MapSource. The profile determines the available layers. To find the available profiles (MapSources) of your iShare instance you can use the GetData.aspx request with the following parameters (for this case, we used the Astun Technology demo server to do the request):

      • RequestType=JSON

      • ms=root

      • Type=MapSource

  • No labels