Add a not editable marker #

Add a Marker on the map which is NOT editable

Add a “local” marker/point on the map with the JS API which cannot be edited by the user. In this example, the marker is added on the local map and not related to any Layer. It’s possible to link an annotation with an existing layer so when a layer is hidden, all related annotations are hidden.

The API method AddMapItem is used to add a feature on the map and the following parameters can be set :

  • items : GeoJSon defining the features to add and all properties
  • layerId : Id of the related layer for the features. If no layer is related set to “”.
  • isShared : indicates if the features added are shared and persistent (true) OR live only in the current session (false)
  • isLocked : Indicates if the features can be moved by the user (false) or not (true). A Locked feature can be still deleted or updated via the JS API.


    <script src=""></script>
    <link rel="stylesheet" href="" />

        html, body {
            height: 100%;
            -ms-touch-action: none;
       var map;
        var MapToken = "Enter your MapToken here";
        Rasters.Map.OnReady = function () {
              map = new Rasters.Map({
                container: 'Map', // container id
                url: '', 
                mapKey: "",
                authenticationMode: Rasters.AuthenticationMode.MapToken,               
                token: MapToken 
   map.OnReady = OnConnectHander;

 function OnConnectHander() {
            map.SetPosition(-71.2170425, 46.810457, 10);    

 function addGeoJSON() { 
      var geoJson = { 
          "type": "Feature",
          "id": "Point1",
          "properties": {
              "name": "Point1", 
              "style.icon": "star"
          "geometry": {
             "type": "Point",
             "coordinates": [-71.217042, 46.810457]
      // Set the last parameter to true (isLocked)
      map.AddMapItems(geoJson, "", false, true);

<div style='width: 100%; height: 400px; position: relative;'>
  <div id="Map" style='width: 100%; height: 100%;'></div>
  <div class="btn-group" style="position: absolute; right: 10px; top: 10px;" >
    <button class="btn btn-default" onclick="addGeoJSON()">Add Point</button>
Help Guide Powered by Documentor
Suggest Edit