IGN API

The Viewer API aims to be a component which allows to programmatically create Viewers on a simple and customizable manner, so that it is reusable not only for new Viewers but also to update existing ones, providing technological standardization and significantly reducing redundant efforts.

Summary
IGN APIThe Viewer API aims to be a component which allows to programmatically create Viewers on a simple and customizable manner, so that it is reusable not only for new Viewers but also to update existing ones, providing technological standardization and significantly reducing redundant efforts.
FeaturesThe API component may be programmatically invoked with a simple JavaScript call involving only two code lines to get a preconfigured viewer with default options.
UsageThe IGN_API_CORE widget is used to load a map based on OpenLayers 3.
GetMapReference to created instance of map based on OpenLayers 3.
AddNewComponentCreate a new component in the Tool Box (Menu Control Panel).
AddZoomControlAdd zoom control to the map, based on OpenLayers 3 ol.control.Zoom.
AddInitExtensionControlAdd initial zoom extension control to the map, based on OpenLayers 3 ol.control.ZoomToExtent.
AddZoomBoxControlAdd control to zoom rectangular box in teh map.
AddSearchControlAdd control to include the search place names or address candidates from IDEE and CartoCiudad services using autocomplete functionality, and select one of them from the list of candidates.
AddDisplayMenuPanelAdd control to display tool box components
RemoveZoomControlRemove zoom control from the map.
RemoveZoomBoxControlRemove control to zoom rectangular box in the map.
RemoveSearchControlRemove control to include the search place names or address candidates from IDEE and CartoCiudad services using autocomplete functionality, and select one of them from the list of candidates.
RemoveInitExtensionControlRemove initial zoom extension control from the map.
RemoverDisplayMenuPanelRemove display menu panel control from the map.
GetZoomControlReference to zoom control instance based on OpenLayers 3.
GetZoomBoxControlReference to zoom rectangular box control instance based on OpenLayers 3.
GetSearchControlReference to the control for searching place names or address candidates from IDEE and CartoCiudad services using autocomplete functionality, and select one of them from the list of candidates.
GetSearchWidgetReference to the selector IGN_search for searching place names or address candidates from IDEE and CartoCiudad services using autocomplete functionality, and select one of them from the list of candidates.
GetInitExtensionControlReference to initial extension control instance based on OpenLayers 3.
GetDisplayMenuPanelReference to the display menu panel control (Tool box).
AddNewVectorAdd new vectorial layers.
SearchFeaturesAdd control to get geojson feature collection related to the search place names or address candidates from IDEE and CartoCiudad services using autocomplete functionality, and select one of them from the list of candidates.
MeasureLinearDistanceDraw and calculate the lineal distance between two points in the map.
MeasureAreaDraw and calculate the area in the map.
DisableMeasuresDisable the measure functionality over the map.
DeleteSelectionDelete all measures and vectorial layers displayed over the map.
SetCenterSet center in the coordinate pointed by the mouse click event.
DisableSetCenterDisable the Set center functionality.
SetStyleMeasureSet new values (see input parameters) to perform a new style for measure geometries (line and area) and associated popups.
SetStyleFeaturePopupSet new values (see input parameters) to perform a new style for vectorial features popups.
ShowPopupShow popup with the information.
RemovePopupRemove popup.
RemoveInfoPopupsRemove information of the popup.
RemoveMeasurePopupsRemove measure of the popup.
RemoveAllPopupsRemove all popups.
RemoveAllOverlaysRemove all overlays.
DeactivateInfoControlDeactivate information control.
DeactivateZoomBoxControlDeactivate zoom box control.
AddWMSLayersShow WMS layers
AddWMTSLayersShow WMTS layers
SetExtentSet initial zoom extension.
SetZoomAdd initial zoom.
ActivateLayersActivate Service Layers.
DesactivateLayersDesactivate Service Layers

Features

The API component may be programmatically invoked with a simple JavaScript call involving only two code lines to get a preconfigured viewer with default options.  In order to do that, a constructor function is provided which links an HTML DIV element of choice to the viewer, so that the developer chooses exactly where he wants the Viewer on his page and which size (width and height).  The internal map object is also returned for detailed customization, if it is required.  Whenever that function is called, the following features are present in a preconfigured viewer (by default):

  • Multilingual (i18n) behavior:
-User browser language is automatically used.  If the selected language is not available, English is used by default
-Currently English and Spanish are available
-All text strings are stored in separate text files.  Adding another language is quick and easy, only another copy with the translated strings and language filename is required.
  • An option to switch among three different backgrounds
-Map: Usually a background based on vector base cartography: http://www.ign.es/wmts/ign-base
-Image: usually a pure raster background with satellite imagery or orthoimagery: http://www.ign.es/wmts/pnoa-ma
-Hybrid:a mix of both, usually with the Map vector as background and imagery on top
  • A dynamic and predictive search widget enabling both place name gazetteer searches and street gazetteer ones when entering any term
  • Basic navigation tools: pan, zoom in, zoom out, mouse wheel zoom, zoom box, zoom to default extent
  • Basic navigation info: scale and mouse coordinates
  • A toolbox implementing an accordion interface and containing additional components, by default, the following:
-Additional toolbar containing linear and polygonal distance measure, a rubber for vector overlays and a center map tool
-A form to add a custom vector layer to the map (in KML, GPX or GeoJSON formats) from an URL or from a file, both provided by the user

The following features are also provided but are not present by default, rather, they should be called to be used

  • A form to add a new WMS or WMTS service as a layer or tiled map from an URL provided by the user
  • A full table-of-contents (TOC): to manage both vector and service layers, with options to activate/deactivate them, remove them, change layer visualization order and choose which one should be used to get contextual info.
  • Getting contextual info from the selected layer by clicking on a feature (calling GetFeatureInfo operation for WMS layers and showing feature details for vector ones).

The map projection is “EPSG:4258”.

Usage

The IGN_API_CORE widget is used to load a map based on OpenLayers 3.

This widget is designed to offer two levels of configuration: default and advanced.

Default level includes next components

  • Zoom
  • Zoom to extent
  • Zoom box
  • Coordinates
  • Scale
  • Place name or address search
  • Switch among: Base map, Image map or Hybrid map
  • Tool Box (sometimes referenced as Menu Panel), where other components are included:
-Tools: measure linear distance, measure area, clear vectorial and measure selection, centre on map.
-Add vector layer from URL or local file.  The allowed formats are: KML, GPX or GeoJSON.

This API allows the next default options

  • divIdMap: “div” element identifier where the widget will be loaded.
  • SRS: reference system for the map (default: 4258)
  • defaultZoom: check to load or unload zoom control.  Possible values are true or false.
  • defaultExtension: check to load or unload to fit the full extent control.  Possible values are true or false.
  • defaultZoomBox: check to load or unload to zoom rectangular box in the map.  Possible values are true or false.
  • defaultSearching: check to load or unload the IGN_search widget as a control.  Possible values are true or false.
  • defaultTools: check to load or unload the display tools control panel.  Possible values are true or false.  The default tools loaded are:
-Tools: lineal and polygonal measurements.
-Add vector layer: to load vectorial layers.

Default level API configuration needs

  • To include in the HTML the IGN_basic.js JavaScript file.
  • To define a HTML DIV for the map whose identifier matches with the identifier added in the invocation to the constructor widget method IGN_API_CORE.
  • To include the invocation to the API widget.

Two performed events have been created to define the callback function for asyncronous operations

  • completeVectorial: Only for vectors added with AddNewVector and AddNewVectorCluster functions.  This event is triggered when the vectorial layers management is finished.  See AddNewVector and AddNewVectorCluster function.
  • completeSearch: Only for place names or address searchs with SearchFeatures function.  This event is triggered when the resultant geojson related to the selected candidate is got.  See Search SearchFeatures function.

To get started, an example is shown describing how to use this API widget in an HTML document, please pay attention to the comments included in the example

<!doctype html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    <!-- <meta http-equiv="X-UA-Compatible" content="IE=edge">-->

    <title>API Visualizador</title>
  </head>
  <body>

  <!-- To load necessary JavaScript libraries -->
  <script type="text/javascript" src="http://componentes.ign.es/PruebasNucleoVisualizador/IGN_basic.js"></script>

  <!-- To define HTML Div map -->
  <div id="map" class="map" style="height:700px"></div>

    <script type="text/javascript">

    //Invocation to the IGN_API_CORE
    $( document ).ready( function () {

        // divIdMap must match with the HMTL Div map identifier
        // To create the map, all default control are activated.

        var apiMap = $('#map').IGN_API_CORE({
            divIdMap: 'map'
        });

        //Method to get map object reference
        var objMap = apiMap.IGN_API_CORE("GetMap");

    });

    </script>

  </body>
</html>

The next example shows the use of some functions offered to the users enable, disable and get references to default controls

<!doctype html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    <!-- <meta http-equiv="X-UA-Compatible" content="IE=edge">-->

    <title>API Visualizador</title>
  </head>
  <body>

  <!-- To load necessary JavaScript libraries -->
  <script type="text/javascript" src="http://componentes.ign.es/PruebasNucleoVisualizador/IGN_basic.js"></script>

  <!-- To define HTML Div map -->
  <div id="map" class="map" style="height:700px"></div>

    <script type="text/javascript">

    //Invocation to the IGN_API_CORE
    $( document ).ready( function () {

        //divIdMap must match with the HMTL Div map identifier
        // To create the map, all default control are activated.
        // To deactivate default controls:
        //  var apiMap = $('#map').IGN_API_CORE({divIdMap: 'map',
        //  defaultZoom: false,
        //  defaultExtension: false,
        //  defaultZoomBox: false,
        //  defaultSearching: false,
        //  defaultTools:false});

        var apiMap = $('#map').IGN_API_CORE({
            //completeVectorial:function(event,result){
            //if (result.input.length>0)
                //alert(result.result + " "  + result.input[0] + " "  + result.input[1] + " "  + result.input[2]);
            //else
                //alert(result.result);},
            divIdMap: 'map',
            defaultZoom: true,
            defaultExtension: true,
            defaultZoomBox: true,
            defaultSearching: true,
            defaultTools: true
        });


        //Methods to enable and to disable map default control and get references to these controls
        var zoomControl = apiMap.IGN_API_CORE("GetZoomControl");

        apiMap.IGN_API_CORE("RemoveZoomControl");

        apiMap.IGN_API_CORE("AddZoomControl");

        var initExtControl = apiMap.IGN_API_CORE("GetInitExtensionControl");

        apiMap.IGN_API_CORE("RemoveInitExtensionControl");

        apiMap.IGN_API_CORE("AddInitExtensionControl");

        var zoomBoxControl = apiMap.IGN_API_CORE("GetZoomBoxControl");

        apiMap.IGN_API_CORE("RemoveZoomBoxControl");

        apiMap.IGN_API_CORE("AddZoomBoxControl");

        var buscControl = apiMap.IGN_API_CORE("GetSearchControl");

        $(window).load(function() {
            var buscWidget = apiMap.IGN_API_CORE("GetSearchWidget");
        });

        apiMap.IGN_API_CORE("RemoveSearchControl");

        apiMap.IGN_API_CORE("AddSearchControl");

        var displayControl = apiMap.IGN_API_CORE("GetDisplayMenuPanel");

        apiMap.IGN_API_CORE("RemoverDisplayMenuPanel");

        apiMap.IGN_API_CORE("AddDisplayMenuPanel");

        //Method to get map object reference
        var objMap = apiMap.IGN_API_CORE("GetMap");

        // Add programmatically a new vectorial layer, the result is returned when the event "completeVectorial" is launched,
        // the management for the callback function is defined in the IGN_API_CORE widget creation
        apiMap.IGN_API_CORE("AddNewVector","EPSG:4326","http://componentes.ign.es/PruebasNucleoVisualizador/vectorial_examples/proximos.kml","KML");
        // Add programmatically a new vectorial layer with clustering the vectors, the result is returned when the event "completeVectorial" is launched,
        // the management for the callback function is defined in the IGN_API_CORE widget creation
        apiMap.IGN_API_CORE("AddNewVectorCluster","EPSG:4326","http://www.ign.es/resources/concurso/delegacionesIGN.kml","KML","40",true);

    });

    </script>

  </body>
</html>

Advanced level configuration includes default level configuration and allows the users add more functionalities programmatically.

  • Add a new WMS, Web Map Service, as a layer from an URL provided by the user
  • Add a new WMTS, Web Map Tile Service, as a tiled web map from an URL provided by the user
  • Maps table-of-contents (TOC): to manage both vector and service layers, with options to activate/deactivate them, remove them, change layer visualization order and choose which one should be used to get contextual info.

The functionalities are added to the tool box as new components.  The way to add this new components is

  • To include in the HTML the IGN_middle.js JavaScript file.
  • To define a HTML DIV for the map whose identifier matches with the identifier added in the invocation to the constructor widget method IGN_API_CORE.
  • To define the selector pointing to the HTML DIV element that links the new component.
  • To invoke the AddNewComponent function.
  • To invoke the new constructor widget method, corresponding to the new functionalities.

The next example shows the way to add these components

<!doctype html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    <!-- <meta charset="iso-8859-1">-->
    <meta http-equiv="X-UA-Compatible" content="IE=edge">


    <title>IGN API</title>


</head>
<body>

    <!-- To load necessary JavaScript libraries -->
    <script type="text/javascript" src="http://componentes.ign.es/PruebasNucleoVisualizador/IGN_middle.js"></script>

    <!-- To define HTML Div map -->
    <div id="map" class="map" style="height:700px"></div>

    <script type="text/javascript">

    $( document ).ready( function () {
        var apiMap = $('#map').IGN_API_CORE({
                divIdMap: 'map',
                defaultZoom: true,
                defaultExtension: true,
                defaultZoomBox: true,
                defaultSearching: true,
                defaultTools: true
            });

        //Method to get map object reference
        var objMap = apiMap.IGN_API_CORE("GetMap");
        //Add new components to the tool box
        var newControlAddLayers = $('<div id="addNewLayers"></div>');
        // Method "AddNewComponent" to add the new component with title "Introducir Mapas"
        apiMap.IGN_API_CORE("AddNewComponent",newControlAddLayers,"Introducir Mapas","Introducir_Mapas");

        //Add new components to the tool box
        var newControlMapLayers = $('<div id="newMapLayers"></div>');
        // Method "AddNewComponent" to add the new component with title "Mapas"
        apiMap.IGN_API_CORE("AddNewComponent",newControlMapLayers,"Mapas","Mapas");

        //Launch IGN_Map_Layers widget invocation
        var managMapLay = newControlMapLayers.IGN_Map_Layers({map: objMap});
        //Launch IGN_Service_Layers widget invocation
        var managLay = newControlAddLayers.IGN_Service_Layers({map: objMap});
        });

    </script>

  </body>
</html>

GetMap

GetMap: function()

Reference to created instance of map based on OpenLayers 3.

Returns

The reference to the instance of map based on OpenLayers 3: “ol.Map”.

AddNewComponent

AddNewComponent: function(newCompDiv,
title,
id)

Create a new component in the Tool Box (Menu Control Panel).

Parameters

  • newCompDiv: selector pointing to the HTML DIV element that links with the new component.
  • title: tittle of the new component.
  • id: identifier of the HTML DIV that is appended to the tool box.

AddZoomControl

AddZoomControl: function()

Add zoom control to the map, based on OpenLayers 3 ol.control.Zoom.

AddInitExtensionControl

AddInitExtensionControl: function()

Add initial zoom extension control to the map, based on OpenLayers 3 ol.control.ZoomToExtent.

AddZoomBoxControl

AddZoomBoxControl: function()

Add control to zoom rectangular box in teh map.

AddSearchControl

AddSearchControl: function()

Add control to include the search place names or address candidates from IDEE and CartoCiudad services using autocomplete functionality, and select one of them from the list of candidates.

AddDisplayMenuPanel

AddDisplayMenuPanel: function()

Add control to display tool box components

  • Tools: lineal and polygonal measurements, remove tool and rectangular zoom.
  • Add vector layer: to load vectorial layers.
  • New components added by AddNewComponent function.

RemoveZoomControl

RemoveZoomControl: function()

Remove zoom control from the map.

RemoveZoomBoxControl

RemoveZoomBoxControl: function()

Remove control to zoom rectangular box in the map.

RemoveSearchControl

RemoveSearchControl: function()

Remove control to include the search place names or address candidates from IDEE and CartoCiudad services using autocomplete functionality, and select one of them from the list of candidates.

RemoveInitExtensionControl

RemoveInitExtensionControl: function()

Remove initial zoom extension control from the map.

RemoverDisplayMenuPanel

RemoverDisplayMenuPanel: function()

Remove display menu panel control from the map.

GetZoomControl

GetZoomControl: function()

Reference to zoom control instance based on OpenLayers 3.

Returns

The reference to the zoom control based on OpenLayers 3: “ol.control.Zoom”.

GetZoomBoxControl

GetZoomBoxControl: function()

Reference to zoom rectangular box control instance based on OpenLayers 3.

Returns

The reference to the zoom rectangular box control.

GetSearchControl

GetSearchControl: function()

Reference to the control for searching place names or address candidates from IDEE and CartoCiudad services using autocomplete functionality, and select one of them from the list of candidates.

Returns

The reference to the control for searching place names or address candidates, based on OpenLayers 3: “ol.control.Control”.

GetSearchWidget

GetSearchWidget: function()

Reference to the selector IGN_search for searching place names or address candidates from IDEE and CartoCiudad services using autocomplete functionality, and select one of them from the list of candidates.  Important: It`s necessary to load all windows content before to get the reference, so the way to call the funtion shall be:

$(window).load(function() {
       var buscWidget = apiMap.IGN_API_CORE("GetSearchWidget");
});

Returns

The reference to the selector IGN_search for searching place names or address candidates.

GetInitExtensionControl

GetInitExtensionControl: function()

Reference to initial extension control instance based on OpenLayers 3.

Returns

The reference to the initial extension control based on OpenLayers 3: “ol.control.ZoomToExte”.

GetDisplayMenuPanel

GetDisplayMenuPanel: function()

Reference to the display menu panel control (Tool box).

Returns

The reference to the display menu panel control instance based on OpenLayers 3: “ol.control.Control”.

AddNewVector

AddNewVector: function(projType,
vectorIGN,
vectorType,
zoomLevel)

Add new vectorial layers.  This is an asyncronous operation, the result is sent when the completeVectorial event is triggered.  The user can define the callback function in the IGN_API_CORE widget creation.

    var apiMap = $('#map').IGN_API_CORE({
    completeVectorial:function(event,result){
        if (result.input.length>0)
            alert(result.result + " "  + result.input[0] + " "  + result.input[1] + " "  + result.input[2]);
        else
            alert(result.result);},
    divIdMap: 'map',
    SRS:'4258',
    defaultZoom: true,
    defaultExtension: true,
    defaultZoomBox: true,
    defaultSearching: true,
    defaultTools:true
});

Parameters

  • projType: projection type.  Possible values are EPSG:4258, EPSG:4326 or EPSG:3857.
  • vectorIGN: url vector layer.
  • vectorType: GPX [EPSG:4326], KML [EPSG:4326] or GeoJSON [EPSG:4258,EPSG:4326,EPSG:3857].
  • zoomLevel: set initial zoom level

Returns

returnValue: _ResultNewVector structure:

  • returnValue.result: “Error”, “Valid” or “Repeated”.
  • returnValue.input: input parameters.

SearchFeatures

SearchFeatures: function()

Add control to get geojson feature collection related to the search place names or address candidates from IDEE and CartoCiudad services using autocomplete functionality, and select one of them from the list of candidates.  This is an asyncronous operation, the result is sent when the completeSeacrh event is triggered.  The user can define the callback function in the IGN_API_CORE widget creation.

    var apiMap = $('#map').IGN_API_CORE({
    completeSearch:function(event,result){
        apiMap.IGN_API_CORE("DrawSearchFeature",result);
    },
    divIdMap: 'map',
    SRS: '4258'
    defaultZoom: true,
    defaultExtension: true,
    defaultZoomBox: true,
    defaultSearching: false,
    defaultTools:true
});

apiMap.IGN_API_CORE(“SearchFeatures”);

This method musn`t be used with default searching control activated.  If user has fogotten put defaultSearching option to false, then this method performs it.

MeasureLinearDistance

MeasureLinearDistance: function()

Draw and calculate the lineal distance between two points in the map.  If other measures with their geometries are drawn before over the map then they are removed.

MeasureArea

MeasureArea: function()

Draw and calculate the area in the map.  If other measures with their geometries are drawn before over the map then they are removed.

DisableMeasures

DisableMeasures: function()

Disable the measure functionality over the map.

DeleteSelection

DeleteSelection: function()

Delete all measures and vectorial layers displayed over the map.

SetCenter

SetCenter: function()

Set center in the coordinate pointed by the mouse click event.

DisableSetCenter

DisableSetCenter: function()

Disable the Set center functionality.

SetStyleMeasure

SetStyleMeasure: function(geomBorderColor,
geomFillColor,
geomLineDash,
geomBorderWidth,
pointerRadius,
pointerBorderColor,
pointerFillColor,
geomEndBorderColor,
geomEndFillColor,
geomEndBorderWidth,
popupBorderColor,
popupFontColor,
popupFontSize,
popupfontFamily,
popupWidth)

Set new values (see input parameters) to perform a new style for measure geometries (line and area) and associated popups.

Parameters

  • geomBorderColor: border color for geometry (line or area) while it is been drawing.
  • geomFillColor: color for fill area geometry while it is been drawing.  Following format is required ‘rgba(red,green,blue,opacity)’.  Eg: ‘rgba(0,132,159,0.3)’.
  • geomLineDash: line dash for geometry, until it is finished of drawing.  It is represented by a vector with two elements: [5,5] or [10,10] or [] for continuous line.
  • geomBorderWidth: line border width for geometry while it is been drawing.
  • pointerRadius: pointer radius.  Pointer is the circle image is used to draw geometry.
  • pointerBorderColor: pointer border color.
  • pointerFillColor: pointer fill color.
  • geomEndBorderColor: border color for geometry (line or area) once it is finished.
  • geomEndFillColor: color for fill area geometry once it is finished.  Following format is required ‘rgba(red,green,blue,opacity)’.  Eg: ‘rgba(0,132,159,0.3)’.
  • geomEndBorderWidth: line border width for geometry once it is finished.
  • popupBorderColor: border color for measure popup.
  • popupFontColor: font color for measure popup.
  • popupFontSize: font size for measure popup.
  • popupfontFamily: font family for measure popup.
  • popupWidth: width of measure popup.

SetStyleFeaturePopup

SetStyleFeaturePopup: function(popupBorderColor,
popupFontColor,
popupFontSize,
popupfontFamily,
popupWidth)

Set new values (see input parameters) to perform a new style for vectorial features popups.

Parameters

  • popupBorderColor: color border popup.
  • popupFontColor: font color popup.
  • popupFontSize: font size popup.
  • popupfontFamily: font family popup.
  • popupWidth: popup width.

ShowPopup

ShowPopup:function (popupType,
popupPosition,
popupInfo)

Show popup with the information.

Parameters

  • popupType: information or measure popup.
  • popupPosition: position popup.
  • popupInfo: content popup.

RemovePopup

RemovePopup:function(popupToRemove)

Remove popup.

Parameters

  • popupToRemove: popup to remove.

RemoveInfoPopups

RemoveInfoPopups:function()

Remove information of the popup.

RemoveMeasurePopups

RemoveMeasurePopups:function()

Remove measure of the popup.

RemoveAllPopups

RemoveAllPopups:function()

Remove all popups.

RemoveAllOverlays

RemoveAllOverlays:function()

Remove all overlays.

DeactivateInfoControl

DeactivateInfoControl: function()

Deactivate information control.

DeactivateZoomBoxControl

DeactivateZoomBoxControl: function()

Deactivate zoom box control.

AddWMSLayers

AddWMSLayers: function(wmsLayer)

Show WMS layers

Parameters

  • wmsLayer: url of wms Layer.

AddWMTSLayers

AddWMTSLayers: function(wmtsLayer)

Show WMTS layers

Parameters

  • wmtsLayer: url of wmts Layer.

SetExtent

SetExtent: function(xmin,
ymin,
xmax,
ymax)

Set initial zoom extension.

Parameters

  • xmin: Bottom-left X-coordinate of an extent.
  • ymin: Bottom-left Y-coordinate of an extent.
  • ymin: Top-right X-coordinate of an extent.
  • ymax: Top-right Y-coordinate of an extent.

SetZoom

SetZoom: function(zoom)

Add initial zoom.

Parameters

  • zoom: specific zoom level.

ActivateLayers

ActivateLayers: function(layers)

Activate Service Layers.

Parameters

  • layers: Layers names

DesactivateLayers

DesactivateLayers: function(layers)

Desactivate Service Layers

Parameters

  • layers: Layers names
GetMap: function()
Reference to created instance of map based on OpenLayers 3.
AddNewComponent: function(newCompDiv,
title,
id)
Create a new component in the Tool Box (Menu Control Panel).
AddZoomControl: function()
Add zoom control to the map, based on OpenLayers 3 ol.control.Zoom.
AddInitExtensionControl: function()
Add initial zoom extension control to the map, based on OpenLayers 3 ol.control.ZoomToExtent.
AddZoomBoxControl: function()
Add control to zoom rectangular box in teh map.
AddSearchControl: function()
Add control to include the search place names or address candidates from IDEE and CartoCiudad services using autocomplete functionality, and select one of them from the list of candidates.
AddDisplayMenuPanel: function()
Add control to display tool box components
RemoveZoomControl: function()
Remove zoom control from the map.
RemoveZoomBoxControl: function()
Remove control to zoom rectangular box in the map.
RemoveSearchControl: function()
Remove control to include the search place names or address candidates from IDEE and CartoCiudad services using autocomplete functionality, and select one of them from the list of candidates.
RemoveInitExtensionControl: function()
Remove initial zoom extension control from the map.
RemoverDisplayMenuPanel: function()
Remove display menu panel control from the map.
GetZoomControl: function()
Reference to zoom control instance based on OpenLayers 3.
GetZoomBoxControl: function()
Reference to zoom rectangular box control instance based on OpenLayers 3.
GetSearchControl: function()
Reference to the control for searching place names or address candidates from IDEE and CartoCiudad services using autocomplete functionality, and select one of them from the list of candidates.
GetSearchWidget: function()
Reference to the selector IGN_search for searching place names or address candidates from IDEE and CartoCiudad services using autocomplete functionality, and select one of them from the list of candidates.
GetInitExtensionControl: function()
Reference to initial extension control instance based on OpenLayers 3.
GetDisplayMenuPanel: function()
Reference to the display menu panel control (Tool box).
AddNewVector: function(projType,
vectorIGN,
vectorType,
zoomLevel)
Add new vectorial layers.
SearchFeatures: function()
Add control to get geojson feature collection related to the search place names or address candidates from IDEE and CartoCiudad services using autocomplete functionality, and select one of them from the list of candidates.
MeasureLinearDistance: function()
Draw and calculate the lineal distance between two points in the map.
MeasureArea: function()
Draw and calculate the area in the map.
DisableMeasures: function()
Disable the measure functionality over the map.
DeleteSelection: function()
Delete all measures and vectorial layers displayed over the map.
SetCenter: function()
Set center in the coordinate pointed by the mouse click event.
DisableSetCenter: function()
Disable the Set center functionality.
SetStyleMeasure: function(geomBorderColor,
geomFillColor,
geomLineDash,
geomBorderWidth,
pointerRadius,
pointerBorderColor,
pointerFillColor,
geomEndBorderColor,
geomEndFillColor,
geomEndBorderWidth,
popupBorderColor,
popupFontColor,
popupFontSize,
popupfontFamily,
popupWidth)
Set new values (see input parameters) to perform a new style for measure geometries (line and area) and associated popups.
SetStyleFeaturePopup: function(popupBorderColor,
popupFontColor,
popupFontSize,
popupfontFamily,
popupWidth)
Set new values (see input parameters) to perform a new style for vectorial features popups.
ShowPopup:function (popupType,
popupPosition,
popupInfo)
Show popup with the information.
RemovePopup:function(popupToRemove)
Remove popup.
RemoveInfoPopups:function()
Remove information of the popup.
RemoveMeasurePopups:function()
Remove measure of the popup.
RemoveAllPopups:function()
Remove all popups.
RemoveAllOverlays:function()
Remove all overlays.
DeactivateInfoControl: function()
Deactivate information control.
DeactivateZoomBoxControl: function()
Deactivate zoom box control.
AddWMSLayers: function(wmsLayer)
Show WMS layers
AddWMTSLayers: function(wmtsLayer)
Show WMTS layers
SetExtent: function(xmin,
ymin,
xmax,
ymax)
Set initial zoom extension.
SetZoom: function(zoom)
Add initial zoom.
ActivateLayers: function(layers)
Activate Service Layers.
DesactivateLayers: function(layers)
Desactivate Service Layers
Close