IGN API_Plugin

The API_Plugin groups all the functions to initialize the different components of the map.  All the components are initialized once they have been created.

Summary
IGN API_PluginThe API_Plugin groups all the functions to initialize the different components of the map.
Functions
InitVectorLayerFunction initializing the vector layer, preparing the loading of vector layers.
InitControlPanelFunction initializing the control panel, preparing the tool box and the listeners for the different functionalities such as measuring, cleaning or centering the map.
InitServiceLayersFunction initializing the service layer, preparing the map for the loading of WMS or wMTS layer.
InitMapLayersFunction initializing the map layer, preparing the layer tree, which is exactly the same as the openlayer layer array Listeners have to be defined to apply the changes that can be done on the openlayer array at the layer tree, so as to keep the structure
docAddVectorAdd new vectorial layers.
docAddVectorClusterAdd the input vector layer to the map, draw its features and add the layer into the TOC.
InitSearchFunction initializing the search module
InitApiCoreFunction called after creating the Map to initialize its components
ComprobarCondicionesAtribucionesFunction that verify 2 conditions, zoom level and visible layer.
ComprobarAtribucionesFunction called to replace the attribution name depending on the area where the center of the image is.
isMobileSpecifies if the API is displayed in a mobile device

Functions

InitVectorLayer

InitVectorLayer: function(elementSetVector)

Function initializing the vector layer, preparing the loading of vector layers.

Parameters

  • elementSetVector: id of the vector layer.

InitControlPanel

InitControlPanel : function(elementSetVector)

Function initializing the control panel, preparing the tool box and the listeners for the different functionalities such as measuring, cleaning or centering the map.

Parameters

  • elementSetVector: id of the control panel.

InitServiceLayers

InitServiceLayers: function(elementSetVector)

Function initializing the service layer, preparing the map for the loading of WMS or wMTS layer.

Parameters

  • elementSetVector: id of the service layer.

InitMapLayers

InitMapLayers : function(elementSetVector)

Function initializing the map layer, preparing the layer tree, which is exactly the same as the openlayer layer array Listeners have to be defined to apply the changes that can be done on the openlayer array at the layer tree, so as to keep the structure

Parameters

  • elementSetVector: id of the map layer.

docAddVector

docAddVector : function(projType,
vectorIGN,
vectorType,
this_API_CORE,
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].
  • this_API_CORE: API_CORE components containing the map
  • zoomLevel: set initial zoom level

Returns

returnValue: _ResultNewVector structure:

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

docAddVectorCluster

docAddVectorCluster : function(projType,
vectorIGN,
vectorType,
this_API_CORE,
distance,
showFeatures,
zoomLevel)

Add the input vector layer to the map, draw its features and add the layer into the TOC.

    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 or EPSG:4326.
  • vectorIGN: url vector layer.
  • vectorType: KML.
  • this_API_CORE: API_CORE components containing the map
  • distance: distance between vectors.
  • showFeatures: show grouped features on hover interaction when true.
  • zoomLevel: set initial zoom level

Returns

returnValue: _ResultNewVector structure:

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

InitSearch

InitSearch : function(objMap)

Function initializing the search module

Parameters

  • objMap: Object that will host the search module

InitApiCore

InitApiCore : function()

Function called after creating the Map to initialize its components

ComprobarCondicionesAtribuciones

ComprobarCondicionesAtribuciones: function()

Function that verify 2 conditions, zoom level and visible layer.

ComprobarAtribuciones

ComprobarAtribuciones: function(extensionMapa,
fileKML)

Function called to replace the attribution name depending on the area where the center of the image is.  The attribution specifies the province only for zoom > 14

isMobile

isMobile:function()

Specifies if the API is displayed in a mobile device

Returns: whether it is mobile or not

InitVectorLayer: function(elementSetVector)
Function initializing the vector layer, preparing the loading of vector layers.
InitControlPanel : function(elementSetVector)
Function initializing the control panel, preparing the tool box and the listeners for the different functionalities such as measuring, cleaning or centering the map.
InitServiceLayers: function(elementSetVector)
Function initializing the service layer, preparing the map for the loading of WMS or wMTS layer.
InitMapLayers : function(elementSetVector)
Function initializing the map layer, preparing the layer tree, which is exactly the same as the openlayer layer array Listeners have to be defined to apply the changes that can be done on the openlayer array at the layer tree, so as to keep the structure
docAddVector : function(projType,
vectorIGN,
vectorType,
this_API_CORE,
zoomLevel)
Add new vectorial layers.
docAddVectorCluster : function(projType,
vectorIGN,
vectorType,
this_API_CORE,
distance,
showFeatures,
zoomLevel)
Add the input vector layer to the map, draw its features and add the layer into the TOC.
InitSearch : function(objMap)
Function initializing the search module
InitApiCore : function()
Function called after creating the Map to initialize its components
ComprobarCondicionesAtribuciones: function()
Function that verify 2 conditions, zoom level and visible layer.
ComprobarAtribuciones: function(extensionMapa,
fileKML)
Function called to replace the attribution name depending on the area where the center of the image is.
isMobile:function()
Specifies if the API is displayed in a mobile device
Close