ixmaps

ixmaps

Classes

mapApi
themeApi

Members

(static) api

Source:
if true, we are in an api layer

(static) embeddedApi

Source:
array to store the api objects of embedded ixmaps windows which have registered to this (HTML) parent

(static) masterApi

Source:
holds the api of the map which will have the role of master

Methods

(static) changeFeatureScaling(szMap, nDelta)

Source:
change the feature scaling of the map
Parameters:
Name Type Description
szMap String the name of the embedded map [optional] null if there is only one map
nDelta Number a numeric factor to scale the objects size with
Returns:
void

(static) changeLabelScaling(szMap, nDelta)

Source:
change the label scaling of the map
Parameters:
Name Type Description
szMap String the name of the embedded map [optional] null if there is only one map
nDelta Number a numeric factor to scale the objects size with
Returns:
void

(static) changeLineScaling(szMap, nDelta)

Source:
change the line scaling of the map
Parameters:
Name Type Description
szMap String the name of the embedded map [optional] null if there is only one map
nDelta Number a numeric factor to scale the objects size with
Returns:
void

(static) changeObjectScaling(szMap, nDelta)

Source:
change the object (charts) scaling of the map
Parameters:
Name Type Description
szMap String the name of the embedded map [optional] null if there is only one map
nDelta Number a numeric factor to scale the objects size with
Returns:
void

(static) changeThemeStyle(szMap, szTheme, szStyle, szFlag)

Source:
change the style of one theme, if the theme (szTheme) is not defined, the top most theme is changed
Examples
ixmaps.changeThemeStyle(null,null,"opacity:0.5","factor");
ixmaps.changeThemeStyle("map1",null,"type:AGGREGATE","add");
Parameters:
Name Type Description
szMap String the name of the embedded map [optional] null if there is only one map
szTheme String the name of the theme [optional] if null it refers to the upmost or only theme
szStyle String a style definition string (see documentation)
szFlag String the style change method ('set' or 'factor' or 'remove' - see api doc)
Returns:
void

(static) clearAll(szMap)

Source:
remove all themes (choropleth, symbol or chart symbols) from the map
Parameters:
Name Type Description
szMap String the name of the embedded map [optional] null if there is only one map
Returns:
void

(static) clearAllCharts(szMap)

Source:
remove all chart themes (symbol or chart symbols) from the map
Parameters:
Name Type Description
szMap String the name of the embedded map [optional] null if there is only one map
Returns:
void

(static) clearAllChoropleth(szMap)

Source:
remove all choropleth themes from the map
Parameters:
Name Type Description
szMap String the name of the embedded map [optional] null if there is only one map
Returns:
void

(static) confirm(szText, callOk, callCancel)

Source:
show confirm dialog
Parameters:
Name Type Description
szText a message
callOk the function to call on ok
callCancel the function to call on cancel
Returns:
void

(static) embedMap(szTargetDiv, opt, fCallBack)

Source:
embedMap
Example
<!DOCTYPE html>
<html>
  <body>
    <div id="map_div"></div>
  </body>

    <script type="text/javascript" src = "../../ui/js/htmlgui_api.js" > </script>
    <script type="text/javascript" charset="utf-8">

    ixmaps.embedMap("map_div",
      { 
         mapName:    "map", 
         mapService: "leaflet",
         mapType:    "OpenStreetMap - FR"
      }
    ); 
    </script>
</html>
Parameters:
Name Type Description
szTargetDiv String the id of the
to host the map
opt Object a JSON object that describes the map source
fCallBack function the function to call, if the map is loaded
Returns:
void

(static) error(szText)

Source:
show error message
Parameters:
Name Type Description
szText the error message
Returns:
void

(static) filterThemeItems(szMap, szThemeId, szFilter, mode)

Source:
filter theme items
Parameters:
Name Type Description
szMap String the name of the embedded map [optional] null if there is only one map
szThemeId String the id of the theme received on create
szFilter String the filter string
mode String an additional flag
Returns:
void

(static) getBookmarkString(szMap) → {String}

Source:
get a complete bookmark string to reproduce map, view and themes
Parameters:
Name Type Description
szMap String the name of the embedded map [optional] null if there is only one map
Returns:
executable Javascript to reproduce the map; a comlete bookmark
Type
String

(static) getBoundingBox(szMap) → {Array}

Source:
get the actual bounding box of the map view
Parameters:
Name Type Description
szMap String the name of the embedded map [optional] null if there is only one map
Returns:
SW and NE point bounding box as array of 4 numbers (see: ixmaps.setBounds)
Type
Array

(static) getCenter(szMap) → {Array}

Source:
get the actual center of the map view
Parameters:
Name Type Description
szMap String the name of the embedded map [optional] null if there is only one map
Returns:
center as lat/lon array (format see: ixmaps.setCenter)
Type
Array

(static) getData(szMap, szItem) → {Object}

Source:
get the data of a theme object or map item
Parameters:
Name Type Description
szMap String the name of the embedded map [optional] null if there is only one map
szItem String the id of the theme item or map item
Returns:
the data as JSON object
Type
Object

(static) getEnvelopeString(szMap, nZoom) → {String}

Source:
get a JavaScript string to set the maps envelove (bounds)
Parameters:
Name Type Description
szMap String the name of the embedded map [optional] null if there is only one map
nZoom Integer optional parameter (2,3,4,...) to get a zoomed envelope
Returns:
executable Javascript to set the map bounds; part of a bookmark
Type
String

(static) getLayer(szMap) → {Array}

Source:
get layer info array
Parameters:
Name Type Description
szMap String the name of the embedded map [optional] null if there is only one map
Returns:
array of layer objects
Type
Array

(static) getLayerDependency(szMap) → {Array}

Source:
get layer dependency list
Parameters:
Name Type Description
szMap String the name of the embedded map [optional] null if there is only one map
Returns:
array of layer dependency objects
Type
Array

(static) getMapTypeId(szMap) → {String}

Source:
get the (base)map type; returns the name of the actual maptype of the basemap (examples: 'roads','satellite')
Parameters:
Name Type Description
szMap String the map name [optional]
Returns:
the actual map type
Type
String

(static) getMapUrl(szMap) → {String}

Source:
get the url of the actual loaded SVG map
Parameters:
Name Type Description
szMap String the map name [optional]
Returns:
the URL of the SVG map
Type
String

(static) getStoryUrl(szMap) → {String}

Source:
get the url of the actual loaded story
Parameters:
Name Type Description
szMap String the map name [optional]
Returns:
the URL of the story
Type
String

(static) getThemeDefinitionObj(szMap, szThemeName) → {Object}

Source:
get the definition object of a theme
Parameters:
Name Type Description
szMap String the name of the embedded map [optional] null if there is only one map
szThemeName String the name of the theme [optional] if null it refers to the upmost or only theme
Returns:
the theme definition object (JSON)
Type
Object

(static) getThemeDefinitionString(szMap, szThemeName) → {String}

Source:
get the definition string of a theme
Parameters:
Name Type Description
szMap String the name of the embedded map [optional] null if there is only one map
szThemeName String the name of the theme [optional] if null it refers to the upmost or only theme
Returns:
a serialized representation of the theme definition object (JSON)
Type
String

(static) getThemeObj(szMap, szThemeName) → {Object}

Source:
get the actual theme object, may be different from the definition object
Parameters:
Name Type Description
szMap String the name of the embedded map [optional] null if there is only one map
szThemeName String the name of the theme [optional] if null it refers to the upmost or only theme
Returns:
the actual theme definition object (JSON) which can differ from the definitiuon object
Type
Object

(static) getThemes(szMap) → {array}

Source:
get themes
Parameters:
Name Type Description
szMap String the name of the embedded map [optional] null if there is only one map
Returns:
an array ot the theme ids
Type
array

(static) getThemesString(szMap) → {String}

Source:
get a JavaScript string to create all actual themes of the map
Parameters:
Name Type Description
szMap String the name of the embedded map [optional] null if there is only one map
Returns:
executable Javascript to create all themes; part of a bookmark
Type
String

(static) getThemeStyleString(szMap, szThemeName) → {String}

Source:
get the style of a theme
Parameters:
Name Type Description
szMap String the name of the embedded map [optional] null if there is only one map
szThemeName String the name of the theme [optional] if null it refers to the upmost or only theme
Returns:
the 'style' part of a theme definition to be used for legends
Type
String

(static) getTileInfo(szMap) → {object}

Source:
get tile info object
Parameters:
Name Type Description
szMap String the name of the embedded map [optional] null if there is only one map
Returns:
map tile object
Type
object

(static) getZoom(szMap) → {Number}

Source:
get the actual zoomfactor of the map view
Parameters:
Name Type Description
szMap String the name of the embedded map [optional] null if there is only one map
Returns:
zoomfactor
Type
Number

(static) hideLoading()

Source:
hide loading icon and message
Returns:
void

(static) hideUi()

Source:
hide the user interface of the map(s) (the pan,info,search... buttons)
Returns:
void

(static) isBookmark(szMap)

Source:
check if map has an initial bookmark string given (with the URL)
Parameters:
Name Type Description
szMap String the name of the embedded map [optional] null if there is only one map
Returns:
void

(static) loadMap(szMap, szUrlMap, szUrlStoryopt)

Source:
load a new map (svg/svgz) into an embed context defined by a registered map name
Parameters:
Name Type Attributes Description
szMap String the name of the embedded map [optional] null if there is only one map
szUrlMap String the url of the SVG map to be loaded
szUrlStory String <optional>
parameter to load and activate a story
Returns:
void

(static) loadProject(szMap, szUrlProject)

Source:
load a new project (json) into an embed context defined by a registered map name
Parameters:
Name Type Description
szMap String the name of the embedded map [optional] null if there is only one map
szUrlProject String the url of the SVG map to be loaded
Returns:
void

(static) loadSidebar(szMap, szUrlStory, nWidthopt)

Source:
load a new sidebar content
Parameters:
Name Type Attributes Description
szMap String the name of the embedded map [optional] null if there is only one map
szUrlStory String parameter to load and activate a story
nWidth Number <optional>
defines a new width for the sidebar
Returns:
void

(static) loadStory(szMap, szUrlStory, nWidthopt)

Source:
load a new story; into the sidebar or hidden
Parameters:
Name Type Attributes Description
szMap String the name of the embedded map [optional] null if there is only one map
szUrlStory String parameter to load and activate a story
nWidth Number <optional>
defines a new width for the sidebar where the story sits in
Returns:
void

(static) makeUnselectable(szNodeId)

Source:
helper function to set attribute "unselectable" = "on"
Parameters:
Name Type Description
szNodeId String id of the HTML element to apply the "unselectable" attribute

(static) markThemeClass(szMap, szThemeId, nClass)

Source:
mark theme class
Parameters:
Name Type Description
szMap String the name of the embedded map [optional] null if there is only one map
szThemeId String the id of the theme received on create
nClass Number the number of the theme class
Returns:
void

(static) message(szMessage)

Source:
display a message
Parameters:
Name Type Description
szMessage String the message to display
Returns:
void

(static) minZoom(szMap, nZoom)

Source:
define a minimal zoom level for the map; the user cannot zoom out beyond this level
Parameters:
Name Type Description
szMap String the name of the embedded map [optional] null if there is only one map
nZoom Number the new minimal zoomm level of the view
Returns:
void

(static) newTheme(szMap, szThemeName, opt, fClear)

Source:
create a new Theme on the map; this is the principal method to create theme representations on the map
Example
ixmaps.newTheme("map","Totale complessivo",{  
   layer: "com2011_s",
   field: "Totale complessivo",
   style: {
       type: "CHOROPLETH|EQUIDISTANT",
       colorscheme: [  "5","#FFFDD8","#B5284B","2colors","#FCBA6C" ],
       dbtable: "themeDataObj csv url(http://mysite/mydata/data.csv)",
       lookupfield: "comune"
   },"clear"
});
Parameters:
Name Type Description
szMap String the name of the embedded map [optional] null if there is only one map
szThemeName String a name for the theme [optional]; will be displayed if the theme has no title defined
opt Object a JSON definition of the theme; fro more information, please see documentation
fClear Boolean if true, clears all previous themes
Returns:
void

(static) popupBookmarks(szMap, position)

Source:
show Bookmarks dialog
Parameters:
Name Type Description
szMap String the name of the embedded map [optional] null if there is only one map
position Array x,y screen position for the modal dialog

(static) popupShare(szMap, position)

Source:
show share dialog
Parameters:
Name Type Description
szMap String the name of the embedded map [optional] null if there is only one map
position Array x,y screen position for the modal dialog

(static) popupThemeEditor(szMap, position)

Source:
show Theme Code Editor
Parameters:
Name Type Description
szMap String the name of the embedded map [optional] null if there is only one map
position Array x,y screen position for the modal dialog

(static) popupThemeTable()

Source:
show data table

(static) refreshTheme(szMap, szThemeName)

Source:
refresh a Theme already on the ma reload data and redraw theme
Parameters:
Name Type Description
szMap String the name of the embedded map [optional] null if there is only one map
szThemeName String a name for the theme [optional]; will be displayed if the theme has no title defined
Returns:
void

(static) removeTheme(szMap, szThemeName)

Source:
remove a Theme from the map
Parameters:
Name Type Description
szMap String the name of the embedded map [optional] null if there is only one map
szThemeName String a name for the theme [optional]; will be displayed if the theme has no title defined
Returns:
void

(static) reset()

Source:
reset the map application
Returns:
void

(static) setAutoSwitchInfo(fFlag)

Source:
set the onClick behavior of the map(s); if true, clicking on map symbols changes to 'info' mode
Parameters:
Name Type Description
fFlag true or false (default:false)
Returns:
void

(static) setBounds(szMap, bounds)

Source:
set the view of the map to the given bounding box; the box is defined by 2 points: SW (south,west) and NE (north,east)
Example
ixmaps.setBounds("map",[36.485910216989004,-0.11973237624387232,47.639325496476276,27.80527925124387]);
Parameters:
Name Type Description
szMap String the name of the embedded map [optional] null if there is only one map
bounds Array the new geo bounds with; array of 4 coordinates
Returns:
void

(static) setCenter(szMap, center)

Source:
set the center of a map to a point given in latitide/longitude
Example
ixmaps.setCenter("map",[51.59898731096802,-0.33786544322673245]);
Parameters:
Name Type Description
szMap String the name of the embedded map [optional] null if there is only one map
center Array the new center of the map; array of 2 coordinates
Returns:
void

(static) setExternalData(szMap, data, opt)

Source:
set external data make data present as JavaScript object usable by theme definitions
Example
ixmaps.setExternalData("map",dataObj,{type:"json",name:"theme_data"});
	});
Parameters:
Name Type Description
szMap String the name of the embedded map [optional] null if there is only one map
data object the data object
opt object a javascript object with data definitions; minimal two properties: type and name see example
typethe type of the data object ('json' or 'array')
namethe define the name you can use for themes (dbtable option in ixmaps.newTheme)
Returns:
void

(static) setLocal(szMap, szOrig, szLocal)

Source:
set local strings
Example
ixmaps.setLocal("map","loading","scaricando");
	});
Parameters:
Name Type Description
szMap String the name of the embedded map [optional] null if there is only one map
szOrig String original string
szLocal String local string
Returns:
void

(static) setLocalString(szMap, szOrig, szLocal)

Source:
set local text; localize, change or suppress application messages; nearly every messsage of iXMaps can be changed by this method; simply define a localized message or even only a word of a message; you can also suppress the message defining an empty string ("")
Example
ixmaps.setLocalString("map","creating charts","...");
ixmaps.setLocalString("map","loading data ...","... caricando dati ...");
Parameters:
Name Type Description
szMap String the name of the embedded map [optional] null if there is only one map
szOrig String the string to replace
szLocal String the localized string
Returns:
void

(static) setMapFeatures(szMap, szFeatures)

Source:
Deprecated:
set map features
Example
ixmaps.setMapFeatures("map","popupdelay:250;toolmargintop:60;flushPaintShape:5000;flushChartDraw:5000;featurescaling:true;objectscaling:dynamic;labelscaling:dynamic;dynamiclabel:NOSIZE;labelspace:2.0;checklabeloverlap:NOSQUEEZE;loadsilent:true;");
Parameters:
Name Type Description
szMap String the name of the embedded map [optional] null if there is only one map
szFeatures String a style string like "item1:value1;item2:value2;"
Returns:
void

(static) setMapTool(szId)

Source:
set map tool in all embedded maps; the map tool manages the mouse (touch) input; possible values are:
'pan' zoom and pan the map
'info' query info of map elements by click
'coord' display lat/lon coordinate on click
'measurement' measure distance
'polyline' measure multiple distances
'polybon' measure area20/06/2017
'selectrect' select and aggregate theme values by rectangular buffer
'selectbuffer' select and aggregate theme values by circular buffer
Parameters:
Name Type Description
szId String the map tool to be set (e.g. 'info');
Returns:
void

(static) setMapTypeId(szMap, szId)

Source:
set (base)map type by name; change the (HTML) basemap into type defined for the basemap provider (leaflet,google...)
Parameters:
Name Type Description
szMap String the map name [optional]
szId String the map type id to be set (e.g. 'satellite');
Returns:
void

(static) setMapWidgetMarginTop(szMap, nMarginTop)

Source:
set tool offset top; may be usefull if we need empty space at the page (map) top
Parameters:
Name Type Description
szMap String the name of the embedded map [optional] null if there is only one map
nMarginTop Integer the offset in pixel of the map tools/widgets
Returns:
void

(static) setOptions(szMap, opt)

Source:
set map options, define the maps behavior
Example
ixmaps.setOptions("map",{
		featurescaling:"dynamic",
		labelscaling:"dynamic",
		objectscaling:"dynamic"
	});
Parameters:
Name Type Description
szMap String the name of the embedded map [optional] null if there is only one map
opt Object option object like {item1:value1,item2:value2}
Returns:
void

(static) setScaleParam(szMap, szParam)

Source:
set map scale parameter
Example
ixmaps.setScaleParam("map","normalSizeScale:50000;labelScaling:1.5");
Parameters:
Name Type Description
szMap String the name of the embedded map [optional] null if there is only one map
szParam String a style string like "item1:value1;item2:value2;"
Returns:
void

(static) setSyncMultiMaps(fFlag)

Source:
set the synchronisation behavior of multiple embedded maps
Parameters:
Name Type Description
fFlag true or false (default:false)
Returns:
void

(static) setTheme(szMap, szThemeName, szSourceName)

Source:
Deprecated:
  • in use for map applications which have themes defined in XML; these themes definitions where used to define standalone multitheme SVG map applications
create the given theme
Parameters:
Name Type Description
szMap String the name of the embedded map [optional] null if there is only one map
szThemeName String the name of the theme as defined in the xml file
szSourceName String a (xml) theme definition file
Returns:
void

(static) setView(szMap, center, nZoom)

Source:
set the center and zoom of a map
Example
ixmaps.setView("map1",[51.59898731096802,-0.33786544322673245],10);
Parameters:
Name Type Description
szMap String the name of the embedded map [optional] null if there is only one map
center Array the new center of the map; array of 2 coordinates
nZoom Number the new zoomfactor of the map
Returns:
void

(static) setZoom(szMap, nZoom)

Source:
setZoom
Example
ixmaps.setZoom("map",10);
Parameters:
Name Type Description
szMap String the name of the embedded map [optional] null if there is only one map
nZoom Number the new zoom level of the view
Returns:
void

(static) showLoading(szMessage, flag)

Source:
display a loading icon and a message
Parameters:
Name Type Description
szMessage String the (loading)message to display
flag Boolean if true, show always, also in silent mode
Returns:
void

(static) showUi()

Source:
show the user interface of the map(s) (the pan,info,search... buttons); complement to ixmaps.hideUi
Returns:
void

(static) switchLayer(szMap, szLayerName, fState)

Source:
switch layer
Parameters:
Name Type Description
szMap String the name of the embedded map [optional] null if there is only one map
szLayerName String the name of the layer to switch visible/invisible
fState Boolean true or false
Returns:
void

(static) toggleTheme(szMap, szTheme, optionalopt)

Source:
Deprecated:
  • in use for map applications which have themes defined in XML; these themes definitions where used to define standalone multitheme SVG map applications
toggle a theme given by its name, if theme exists it will be removed
Parameters:
Name Type Attributes Description
szMap String the name of the embedded map [optional] null if there is only one map
szTheme String the name of the theme
optional String <optional>
szSourceName a (xml) theme definition file
Returns:
void

(static) unmarkThemeClass(szMap, szThemeId, nClass)

Source:
unmark theme class
Parameters:
Name Type Description
szMap String the name of the embedded map [optional] null if there is only one map
szThemeId String the id of the theme received on create
nClass Number the number of the theme class
Returns:
void

(static) updatePageHistory(szMap, nZoom, fFlag)

Source:
create a browser bookmark by updating the URL with the actual theme and map view
Parameters:
Name Type Description
szMap String the name of the embedded map [optional] null if there is only one map
nZoom Integer a possible additive zoom for bookmark
fFlag Boolean true or false
Returns:
void

(static) waitForEvent(szMap, fCallBack)

Source:
a function to wait for map events a map can have a specific name or the generic name 'map'
Parameters:
Name Type Description
szMap the name of the embedded map
fCallBack the function to call, if an event occurs
Returns:
void

(static) waitForMap(szMap, fCallBack)

Source:
a function to wait for the embedded map a map can have a specific name or the generic name 'map'
Example
ixmaps.waitForMap("map1",function(){
	 ixmaps.setView("map1",[51.59898731096802,-0.33786544322673245],10);
};
ixmaps.waitForMap("map2",function(){
	 ixmaps.setView("map2",[51.49898731096802,-0.04669189453125003],10);
};
Parameters:
Name Type Description
szMap String the name of the embedded map
fCallBack function the function to call, if the map is loaded
Returns:
void