Class: IMapper

IMapper


new IMapper()

Create a new IMapper instance.

Source:

Methods


addBingTileLayer(bingKey, hybrid)

Add Bing tile layer.

Parameters:
Name Type Description
bingKey string

The key for Bing service.

hybrid boolean

Default: false (Satelite) true: Hybrid.

Source:

addCircle(id, latitude, longitude, radius, name, sym, mouseClick, zindex)

Add a circle by specifying its center point and radius.

Parameters:
Name Type Description
id string

Id of the circle object.

latitude float

The latitude value of center point.

longitude float

The longitude value of center point.

radius float

The radius value of the circle.

name string

The name of the circle object.

sym string

The name of the symbol for circle, as written on the map database.

mouseClick function

The user defined function that is called when the circle is clicked.

zindex int

This method sets the z-index (display order) value of the marker group. The group with a larger z-index value is displayed above the group with a smaller z-index value.

Source:

addCollapsibleMapDecoration(title, width, height, state)

Add a map decoration in lower right corner of the map window.
This object is as same as the map decoration, only appears in a collapsible window and can be minimized.

Parameters:
Name Type Description
title string

Title of the decoration.

width int

The width of map decoration in pixels.

height int

The height of map decoration in pixels.

state int

The Anchor of map decoration. (Default parameter is 4)

Source:

addCustomMarker(id, latitude, longitude, name, mouseClick, zindex)

Add a marker pointing to a specified point.

Any image can be used as a marker.

Parameters:
Name Type Description
id string

Id of the marker.

latitude float

The latitude value of the point.

longitude float

The longitude value of the point.

name string

Name of the marker.

mouseClick function

The user defined function that is called when the marker is clicked.

zindex int

This method sets the z-index (display order) value of the marker group. The group with a larger z-index value is displayed above the group with a smaller z-index value.

Source:

addDistanceMeasuringTool()

Add a distance measuring tool to the map.

Source:

addEarthquakes(mouseClick)

Add Earthquakes to the map.

Parameters:
Name Type Description
mouseClick function

The user defined function that is called when layer is clicked.

Source:

addGoogleTileLayer(googleKey, hybrid)

Add Google tile layer.

Parameters:
Name Type Description
googleKey string

The key for Bing service.

hybrid boolean

Default: false (Satelite) true: Hybrid.

Source:

addImageLayer()

Add image layer to map.

Source:

addLabelToMarker(id, html, textMarker)

Add a label to a specified marker.

Parameters:
Name Type Description
id string

Id of the marker.

html string

The html content of the label.

textMarker string

The textMarker content of the label.

Source:

addLine(id, ordinates, name, sym, mouseClick, zindex, acStyle)

Add a line specified by array of coordinates.

Parameters:
Name Type Description
id string

Id of the line object.

ordinates array

The set of coordinates.

name string

Name of the line object.

sym string

The name of the style object for line, as in the map database or created by user (@See createColorStyle).

mouseClick function

The user defined function that is called when the line is clicked.

zindex int

This method sets the z-index (display order) value of the marker group. The group with a larger z-index value is displayed above the group with a smaller z-index value.

acStyle object

Animation color style can create using mapper.createAnimationColorStyle() method

Source:

addMapDecoration(html, offsetX, offsetY, width, height, collapsible, draggable, title, titleStyle, contentStyle, mouseClick)

Display an HTML map decoration object on the map.
A map decoration object may be placed on top of the map and does not move
while the map is recentered.

Map decoration can be used as a collapsible window (@link addCollapsibleMapDecoration)
so that it can be minimized by the user.

Parameters:
Name Type Description
html string

An HTML content string that is going to be displayed inside the map decoration.

offsetX int

In pixels to the dock icon.

offsetY int

In pixels to the dock icon.

width int

The width of map decoration in pixels.

height int

The height of map decoration in pixels.

collapsible boolean

Defines the collapsible value true or false.

draggable boolean

True if draggable, false if fixed.

title string

The title of the decoration.

titleStyle object

A CSS definition for the Decoration title style. For example:

titleStyle:{border-style:solid,

border-color:#391EA6,

border-width:1px,

backgroundColor:#0D0D0D,

font-size:18px,

font-weight:bold,

color:#FDFDFD
}

contentStyle object

A CSS definition for the Decoration content style. For example:

contentStyle: {border-style:solid,

border-color:#101418,

border-width:2px,

padding:0px,

font-size:16px,

color:#000000,

backgroundColor:#FDFDFD
}

mouseClick function

The function for mouse click event.

Source:

addMapMarker(id, latitude, longitude, markerStyle, labelText, labelStyle, labelTextStyle, draggable, mouseClick, zindex)

Add a mapMarker to a specified point with special features
.

Parameters:
Name Type Description
id string

Id of the marker.

latitude float

The latitude value of the point.

longitude float

The longitude value of the point.

markerStyle object

The style object of mapMarker.

labelText string

Text of mapMarker label.

labelStyle object

The style object of mapMarker label.

labelTextStyle object

The text style object of mapMarker label text.

draggable boolean

Set draggable mapMarker.

mouseClick function

The user defined function that is called when the marker is clicked.

zindex int

This method sets the z-index (display order) value of the marker group. The group with a larger z-index value is displayed above the group with a smaller z-index value.

Source:

addMarker(id, latitude, longitude, name, sym, w, h, mouseClick, zindex)

Add a marker pointing to a specified point.

Parameters:
Name Type Description
id string

Id of the marker.

latitude float

The latitude value of the point.

longitude float

The longitude value of the point.

name string

Name of the marker.

sym string

The name of the style object for marker, as in the map database or created by user. (@See createColorStyle)

w int

The width of marker symbol in pixels.

h int

The height of marker symbol in pixels.

mouseClick function

The user defined function that is called when the marker is clicked.

zindex int

This method sets the z-index (display order) value of the marker group. The group with a larger z-index value is displayed above the group with a smaller z-index value.

Source:

addNavigationPanel(place, backgroundColor, buttonColor, fontSize, infoTips, orientation, style)

Add navigation panel to the map.

Parameters:
Name Type Description
place int

Location of the navigation panel. Can be one of 6 pre-defined options.1--upper left,2--upper center,3--upper right,4--lower left,5--lower center,6--lower right.

backgroundColor string

The background color for the panel. Specified as #rrggbb, e.g. "#d3d3d3".

buttonColor string

The background color for the buttons. Specified as #rrggbb, e.g. "#d3d3d3".

fontSize integer

The font size in panel texts.

infoTips object

E.G. {zoomLevel01:"level01Name",zoomLevel02:"level02Name", ...}.

orientation integer

Orientation of navigationbar default 1.

style string

Specifies the display mode of NavigationPanelBar, Can be one of four pre-defined options. 1--display all, 2--slide bar and zoom buttons only, 3--zoom buttons only, 4--navigation panel only.

Source:

addPharmacyOnDuty()

Add pharmacy on duty layer to the map.

Source:

addPoiList(id, poiList, mouseClick)

Add poi list to the map.

Parameters:
Name Type Description
id string

The id of POI list.

poiList array

The list of POIs.

mouseClick function

The user defined function that is called when layer is clicked.

Source:

addRegion(id, ordinates, name, sym, mouseClick, zindex)

Add a region as a polygon specified by array of coordinates.

Parameters:
Name Type Description
id string

Id of the polygon object.

ordinates array

The set of coordinates.

name string

Name of the polygon object.

sym string

Name of the style object for polygon, as in the map database or created by user. (@See createColorStyle)

mouseClick function

The user defined function that is called when the region is clicked.

zindex int

This method sets the z-index (display order) value of the marker group. The group with a larger z-index value is displayed above the group with a smaller z-index value.

Source:

addRoute(id, pathIds, themeName, mouseClick)

Add an existing route path to the map.

Parameters:
Name Type Description
id string

Id of the route object.

pathIds int

The id of the existing path (See http://www.locationbox.com.tr/web/api_route.jsp).

themeName string

Name of the theme.

mouseClick function

The user defined function that is called when layer is clicked.

Source:

addScaleBar(format, anchorPosition, fontSize, fontColor, fontWeight, scaleBarColor, boxShadow, maxLength)

Add scale bar to the map.

Parameters:
Name Type Description
format string

Specifies the display format (or mode) of ScaleBar, can be one of three pre-defined options; "BOTH", "METRIC", or "IMPERIAL".

anchorPosition int

Specifies where thw scalebar is placed. Can be one of 6 pre-defined options: 1--upper left,2--upper center,3--upper right,4--lower left,5--lower center,6--lower right.

fontSize int

The font size in points.

fontColor string

The color for the scale bar text. Specified as #rrggbb e.g. "#cccccc".

fontWeight int

The font weight.

scaleBarColor string

The color for the scale bar.

boxShadow string

The shadow of the scale bar e.g "1px 1px 5px #000000".

maxLength int

The maximum length of the scale bar in pixels.

Source:

addSocialEvents()

Add social events to the map.

Source:

addText(id, latitude, longitude, content, fontFamily, fontStyle, fontWeight, color, fontSize, sizeUnit)

Add a text feature to a specified layer.

Parameters:
Name Type Description
id int

Id of the feature.

latitude float

The latitude value of the point that info window going to be displayed.

longitude float

The longitude value of the point that info window going to be displayed.

content string

The content of text feature.

fontFamily string

Specifies the font family to be used to render the text.

fontStyle string

Specifies the style (italic or normal) of the font used to render the text.It should be one of two static values: OM.Text.FONTSTYLE_ITALIC or OM.Text.FONTSTYLE_NORMAL.

fontWeight string

Specifies the font weight (bold or normal) used to render the text. It should be one of two static values: OM.Text.FONTWEIGHT_BOLD or OM.Text.FONTWEIGHT_NORMAL.

color string

Specifies the font color. Format is "#rrggbb".

fontSize string

Specifies the font size.

sizeUnit string

Specifies the font size unit. The value can be "pixel", "meter", "kilometer", "feet", "mile". Default value is "pixel".

Source:

addTileLayer(basemap)

Parameters:
Name Type Description
basemap string

Add a TileLayer to the map.

Source:

addTrafficEvents()

Add the traffic event data on the map.

Source:

addTrafficTmc(tmcKodList)

Add the visualized traffic data on the map.

Parameters:
Name Type Description
tmcKodList array

The array of TMC code list.

Source:

addWeatherReport(mouseClick)

Add weather report layer to the map.

Parameters:
Name Type Description
mouseClick function

The user defined function that is called when layer is clicked.

Source:

addYolList(id, yolList)

Add yol list to the map.

Parameters:
Name Type Description
id string

Id of YolList.

yolList array

YolID list.

Source:

animateMarker(id, Ordinates, interval, loop, time, bounce)

Move a marker to a specified position or visit a set of positions.

Parameters:
Name Type Description
id string

Id of the marker.

Ordinates array

The set of coordinates.

interval int

Interval affects the marker moving speed. The default value is 100. A larger value results in a slower movement.

loop boolean

Loop affects activate true or false (default:true).

time int

Time for animation (default:1000ms).

bounce boolean

Bounce affects true or false (default:true).

Source:

animateMarkerFlow(tmcKod, interval, sym, width, height, repeat, factor, reverse)

Animates the marker flow according to TMC code geometries.

Parameters:
Name Type Description
tmcKod string

TMC code.

interval int

Interval affects the marker moving speed. The default value is 100. A larger value results in a slower movement.

sym string

The name of the style object for marker, as in the map database or created by user.

width int

The width of marker symbol in pixels.

height int

The height of marker symbol in pixels.

repeat boolean

Animation repeats (true) or not.

factor string

The interval between repeat time duration.

reverse boolean

Reversed ordinates.

Source:

clearCircleTool()

Clear the circle tool.

Source:

clearDistanceMeasuringTool()

Clear distance measuring tool.

Source:

clearMapListener(event, callback)

Clear map listener from the map.

Parameters:
Name Type Description
event string

Name of the event being listened. (See EventListener for the events.)

callback function

The user defined function that is called when a map event is fired.

Source:

clearMarkerListener(id, event, callback)

Set marker listener.

Parameters:
Name Type Description
id string

Id of the marker.

event object

Types of events.

IMapper.MARKER_MOUSE_CLICK

IMapper.MARKER_MOUSE_OVER

IMapper.MARKER_MOUSE_OUT

IMapper.MARKER_MOUSE_RIGHT_CLICK

callback function

The user defined function that is called when marker is set.

Source:

clearMeasureTool()

Clear the Measure Tool.

Source:

clearPolygonTool()

Cleayer Polygon Tool if exist.

Source:

clearRectangleTool()

Clear the Rectangle Tool.

Source:

clearRedlineTool()

Clear the Red Line Tool.

Source:

createAdvancedStyle(name, symlist)

Create an advanced style object.

Parameters:
Name Type Description
name string

Name of the style.

symlist string

List of styles in JSON format.

Source:
Returns:

Style object containing list of style objects.

Type
object

createAllFilter(filterArray)

This is a combination filter that combines (ANDs) a list of Filter instances. A feature passes this filter only if it passes all the filters in the list.

Parameters:
Name Type Description
filterArray object

An array of OM.filter.Filter instances can create with mapper.createFilter(filterType, attrName, filterValue).

Source:
Returns:

new OM.filter.All object

Type
object

createAndFilter(filter1, filter2)

This is a composite filter based on the logical AND of two filters.

Parameters:
Name Type Description
filter1 object

An instance of OM.filter.Filter can create with mapper.createFilter(filterType, attrName, filterValue).

filter2 object

An instance of OM.filter.Filter can create with mapper.createFilter(filterType, attrName, filterValue).

Source:
Returns:

new OM.filter.And object

Type
object

createAnimationColorStyle(colorFirst, colorSecond, duration, enableMovingDashLine)

This method represents animation style.

Parameters:
Name Type Description
colorFirst object

Begin color style.

colorSecond object

End color style.

duration int

Animation duration. Default value is 5 seconds.

enableMovingDashLine boolean

Enable dash line moving effect. This effect is only for SVG mode.

Source:
Returns:

AnimationColor object.

Type
object

createAnyFilter(filterArray)

This is a combination filter that combines (ANDs) a list of Filter instances. A feature passes this filter only if it passes all the filters in the list.

Parameters:
Name Type Description
filterArray object

An array of OM.filter.Filter instances can create with mapper.createFilter(filterType, attrName, filterValue).

Source:
Returns:

new OM.filter.Any object

Type
object

createAnyInteractFilter(geom)

This is a spatial filter that implements the any-interact relationship. A feature passes this filter if its geometry has any interaction (i.e. is not disjoint) with the filter's geometry.

Parameters:
Name Type Description
geom object

The filtering geometry.

Source:
Returns:

new OM.filter.AnyInteract object

Type
object

createBar(data, color)

This method create a bar with spesific data and its color.

Parameters:
Name Type Description
data string

Bar data name.

color string

The color of the bar data. The string format is "#RRGGBB".

Source:
Returns:

Bar object.

Type
object

createBarChartStyle(styleName, bars, width, height, lengthUnit, enableHighlight, lengthPixelRange)

This method represents a bar chart style. Each instance will render the specified attribute values of a feature as a bar chart at that feature's centroid.

Parameters:
Name Type Description
styleName string

A name for this style instance, e.g. 'salesByRegion'.

bars array

An array of OM.style.Bar. Each bar represents an attribute value.

width int

The bar chart width. Default value is 100 (in lengthUnit whose default is pixels).

height int

The bar chart height. Default value is 100 (in lengthUnit whose default is pixels).

lengthUnit string

The unit of the chart size, it must be "pixel" or "kilometer"; the default unit is pixel.

enableHighlight boolean

If true, highlight a slice on mouse over. The default value is false.

lengthPixelRange object

Specifies the length range of bar chart in pixels when the length unit is kilometer. It has two integer attributes: max and min. They control the height and width range for the bar chart.
max {int} Maximum height in pixels.
min {int} Minimum height in pixels.

Source:
Returns:

Barchart object.

Type
object

createBetweenFilter(filterAttribute, low, high)

This is a filter class that evaluates a feature to check if the specified attribute value falls within a numeric range.

A value passes this filter if it is greater than or equal to the low value and smaller than or equal to the high value.

i.e. the value of expr1 BETWEEN expr 2 and expr3 is the value of

the boolean expression: expr2 <= expr1 AND expr1 <= expr3.

Parameters:
Name Type Description
filterAttribute string

The name of the feature attribute to be evaluated.

low float

Minimum value (inclusive).

high float

Maximum value (inclusive).

Source:
Returns:

new OM.filter.Between object

Type
object

createBucketStyle(name, styles, buckets, classification, numClasses, gradient)

This method represents a bucket style that can be used for thematic mapping of numeric or categorical data.

Parameters:
Name Type Description
name string

Name of the style.

styles array

An array that corresponds to the array of buckets.
That is, style[0] is used for buckets[0] (*Required).

buckets array

An array of OM.style.Bucket. Must be of the same length as the styles array (*Optional).

classification string

The classification scheme. Can be "equal", "logarithmic" or "custom" (*Optional).

numClasses int

The number of classes or buckets (*Required).

gradient string

Whether a gradient effect should be used on all buckets.
The value can be "linear", "on", or "off". Default is "off" (*Optional).

Source:
Returns:

Style object containing list of style objects.

Type
object

createCollectionBucket(values, dataType, keepWhiteSpace)

Creates a collection bucket.

Parameters:
Name Type Description
values array

The value list for this collection bucket.

dataType string

The data type for the values. Default is "string".

keepWhiteSpace boolean

Whether to keep white spaces in the values. Default is "false".

Source:
Returns:

CollectionBucket object.

Type
object

createColorScheme(name, numClasses, classification, defaultStyle, styles, buckets, baseColor, toColor, fromColor, stroke, baseColorOpacity, strokeOpacity)

Creates a color scheme.

Parameters:
Name Type Description
name string

A style name.

numClasses int

The number of buckets, only used when generating equal-range buckets.

classification string

The value can be "equal" or "custom". If it's "equal", all buckets are generated automatically.

defaultStyle object

The default style. Used when a feature's attribute value does not fall within any bucket.

styles array

An array of custom color styles (OM.style.Color) to be used as color stops; if not specified, the color stops will be auto-generated based on the baseColor or fromColor and toColor.

buckets array

The buckets array. Each element in the array is a OM.style.Bucket.

baseColor string

The base fill color string for each bucket. Format is "#rrggbb".

toColor string

The toColor (or final color) for a multi-hue color scheme. Format is "#rrggbb".

fromColor string

The fromColor (or initial color) for a multi-hue color scheme. Format is "#rrggbb".

stroke string

The stroke color. Format is "#rrggbb".

baseColorOpacity int

Base color opacity.

strokeOpacity int

Border color opacity.

Source:
Returns:

Style ColorScheme object.

Type
object

createColorStyle(name, fillColor, fillOpacity, borderColor, borderOpacity, borderWidth)

Create a style object.

Parameters:
Name Type Description
name string

Name of the style.

fillColor string

Filling color. A string in the format of "RRGGBB", or null if no filling.

fillOpacity int

Opacity of the fill color. Opacity value ranges from 0 (completely transparent) to 255 (completely opaque). Default value is 255.

borderColor string

Border color. A string in the format of "RRGGBB".

borderOpacity int

Opacity of the border color. Opacity value ranges from 0 (completely transparent) to 255 (completely opaque). Default value is 255.

borderWidth int

Border width in device point/pixel unit. Default is 1.

Source:
Returns:

Style Color object.

Type
object

createDropShadowStyle(opacity, color, offset, radius)

This method represents a shadow filter that can be applied to vector layers.

Parameters:
Name Type Description
opacity int

The opacity of the shadow. A number between 0 and 1.

color string

The color of the shadow. The string format is "#RRGGBB""

offset int

The offset between the casted shadow and the object (in pixels).

radius int

Defines how hazy, or how blurry, the drop shadow is. Default value is "2".

Source:
Returns:

Drop Shadow object.

Type
object

createFilter(filterType, attrName, filterValue)

Create Spatial Filter.

Parameters:
Name Type Description
filterType object

Types of events.

IMapper.FILTER_EQUALS

IMapper.FILTER_NOTEQUALS

IMapper.FILTER_GREATER

IMapper.FILTER_GREATEREQUALS

IMapper.FILTER_LESS

IMapper.FILTER_LESSEQUALS

IMapper.FILTER_ISNULL

IMapper.FILTER_ISNOTNULL

IMapper.FILTER_IN

attrName string

The name of the feature attribute to be filtered.

filterValue string

The filtering attribute value.

Source:
Returns:

Filter object

Type
object

createGrowStyle(opacity, color, offset, radius)

This method represents a glow filter that can be applied to vector layers.

Parameters:
Name Type Description
opacity int

The opacity of the glow. A number between 0 and 1.

color string

The color of the glow. The string format is "#RRGGBB"

offset int

The offset between the casted glow and the object (in pixels).

radius int

Defines how hazy, or how blurry, the drop shadow is. Default value is "2".

Source:
Returns:

Glow object.

Type
object

createIconMarkerStyle(name, url, width, height)

Create an icon marker style object.

Parameters:
Name Type Description
name string

Name of the style.

url string

Marker image url.

width int

Marker width in pixels.

height int

Marker width in pixels.

Source:
Returns:

Style Marker object

Type
object

createInsideCircleFilter()

This is a filter class that tests if a feature's geometry is inside the specified filter polygon.

Source:
Returns:

new OM.filter.InsidePolygon object

Type
object

createInsideRectangleFilter()

This is a filter class that tests if a feature's geometry is inside the specified filter rectangle.

Source:
Returns:

new OM.filter.InsidePolygon object

Type
object

createLayerControl(anchorPosition, offsetX, offsetY, contentStyle, titleStyle, layerDeleteEnable)

Create Text Style.

Parameters:
Name Type Description
anchorPosition int

Specify where a collapsed layer control will be docked,as well as where the docker icon is positioned.
A set of 6 predefined positions for the panel.
The 6 values are: 1--upper left,2--upper center,3--upper right,4--lower left,5--lower center,6--lower right.

offsetX int

In pixels to the dock icon.

offsetY int

In pixels to the dock icon.

contentStyle object

Specifies the minimum width and maximum height of the panel, and the font used to display the layer names. This object has the following attributes:
minWidth {int} The minimum width of the panel (in pixels).
maxHeight {int} The maximum height of the panel (in pixels).
font_size {int} Font size in points.
font_family {String} Font family name (e.g. Arial).

titleStyle object

Specify the font to use for the title text. This object has the folowing attributes:

font_size {int} Font size in points.

font_family {String} Font family name (e.g. Arial).

layerDeleteEnable boolean

The delete icon will show up when a vector is highlighted. The default value is "false".

Source:
Returns:

Layer Control object.

Type
object

createLikeFilter(filterAtrribute, filterValue)

This is a filter class that implements the "Like" filter similar to the SQL like clause.

Parameters:
Name Type Description
filterAtrribute string

The name of the feature attribute to be tested.

filterValue string

The filtering attribute value.

Source:
Returns:

new OM.filter.Like object

Type
object

createLinearGradient(stops, x1, y1, x2, y2, stroke)

This method defines a linear color gradient.
A linear color gradient fills an area with a color fill that varies from one color to another.
The color varies along a linear axis and all points along a line perpendicular to the axis have the same color.
The color variation is determined by the color stops. A color stop specifies a position along the axis and the colors
at that position. Color values between color stops are interpolated.
The axis is defined by two points on a unit square (i.e. x and y are between 0 and 1) and hence
can be horizontal, vertical, or at an angle (angular).
The x and y values can range from (0,0) to (1,1), where (0,0) is the top left and (1,1) is the bottom right.
The offset for a color stop is the offset along the axis and is a value between 0 (the start) and 1 (the end).
The gradient is a horizontal gradient if y1 = y2 and x1 <> x2.
The gradient is a vertical gradient if x1 = x2 and y1 <> y2 differ.
The gradient is an angular gradient if x1 <> x2 and y1 <> y2.
The gradient is an angular gradient if x1 <> x2 and y1 <> y2.

Parameters:
Name Type Description
stops array

The color stops of the gradient. The color stops are specified by an array of color stop objects Each color stop object has two properties, offset and color,
which specify the stop offset and color respectively. The stop offset is a number between 0
and 1. It specifies the location of the color stop relative to the start point of the gradient.
0 indicates the gradient start point and 1 indicates the gradient end point.
The color is specified by rgba values ("#rrggbbaa)".
Example of a stops array: [{offset:0, color:"#ffffffff"}, {offset:1, color:"#ff0000ff"}]

x1 float

The X ordinate of the gradient's start point. Must be a number between 0 and 1, where 0 indicates the left border of the gradient coordinate system.

y1 float

The Y ordinate of the gradient's start point. Must be a number between 0 and 1, where 0 indicates the top border of the gradient coordinate system.

x2 float

The X ordinate of the gradient's end point. Must be a number between 0 and 1, where 0 indicates the left border of the gradient coordinate system.

y2 float

The Y ordinate of the gradient's end point. Must be a number between 0 and 1, where 0 indicates the top border of the gradient coordinate system.

stroke string

The stroke color. The string format is "#RRGGBB".

Source:
Returns:

Linear Gradient object.

Type
object

createMarkerStyle(name, fillColor, fillOpacity, borderColor, borderOpacity, borderWidth, width, height, lengthUnit, type, cx, cy, shapeWidth, shapeHeight)

Create a marker style object.

Parameters:
Name Type Description
name string

Name of the style.

fillColor string

Filling color. A string in the format of "RRGGBB", or null if no filling.

fillOpacity int

Opacity of the fill color. Opacity value ranges from 0 (completely transparent) to 255 (completely opaque). Default value is 255.

borderColor string

Border color. A string in the format of "RRGGBB".

borderOpacity int

Opacity of the border color. Opacity value ranges from 0 (completely transparent) to 255 (completely opaque). Default value is 255.

borderWidth int

Border width in device point/pixel unit. Default is 1.

width int

Marker width in pixels.

height int

Marker height in pixels.

lengthUnit string

The size unit. Optional.The value can be "pixel", "meter", "kilometer", "feet", or "mile". Default value is "pixel".

type string

The type of the vector shape. Valid values are "circle", "path" or "rectangle".

cx float

The circle's center X ordinate. For "circle" only.

cy float

The circle's center Y ordinate. For "circle" only.

shapeWidth int

The width. Valid for shape types "circle" and "rectangle" only.

shapeHeight int

The height. Valid for shape types "circle" and "rectangle" only.

Source:
Returns:

Style object

Type
object

createNotFilter(filter)

This is a filter class that implements the "NOT" logic. It returns true if a feature does not pass the specified filter.

Parameters:
Name Type Description
filter object

An OM.filter.Filter instance can create with mapper.createFilter(filterType, attrName, filterValue).

Source:
Returns:

new OM.filter.Not object

Type
object

createOrFilter(filter1, filter2)

This is a combo filter that implements the logical "OR" operation of two filters.

Parameters:
Name Type Description
filter1 object

An instance of OM.filter.Filter can create with mapper.createFilter(filterType, attrName, filterValue).

filter2 object

An instance of OM.filter.Filter can create with mapper.createFilter(filterType, attrName, filterValue).

Source:
Returns:

new OM.filter.Or object

Type
object

createPieChartStyle(styleName, slices, enableHighlight, startingAngle, direction, lengthUnit, radiusPixelRange)

This method represents a Pie chart style.

Parameters:
Name Type Description
styleName string

A name for this style instance, e.g. 'salesByRegion'.

slices array

An array.of OM.style.PieSlice.

enableHighlight boolean

If true, highlight a slice on mouse over. The default value is false.

startingAngle int

Angle of the first pie slice center. default value is 0.

direction string

The direction of slices. Value can be "CW" (clockwise) or "CCW" (counter clockwise).Default value is "CCW".

lengthUnit string

The unit of the chart radius. Value can be "pixel" or "kilometer". The default is pixel.

radiusPixelRange object

Specifies the radius range of pie chart by pixel. Used only when length unit is kilometer.The object has two attributes, min and max, both integers with minimum and maximum chart size in pixels.

Source:
Returns:

Piechart object.

Type
object

createPieSlice(data, color)

This method create a pie with spesific data and its color.

Parameters:
Name Type Description
data string

Pie data name.

color string

The color of the bar data. The string format is "#RRGGBB".

Source:
Returns:

Pie Slice object.

Type
object

createPulseAnimation(stroke, duration, beginSize, endSize)

This method represents the pulse animation style for point feature.

Parameters:
Name Type Description
stroke string

The stroke color string as "#RRGGBB".

duration int

The animation duration. Default value is 5 seconds.

beginSize int

Begin marker size in pixels.

endSize int

End marker size in pixels.

Source:
Returns:

Pulse object.

Type
object

createRadialGradient(stops, cy, cx, radius, stroke)

This method defines a radial color gradient.

Parameters:
Name Type Description
stops array

The color stops of the gradient. The color stops are specified by an array of color stop objects. Each color stop object has two properties, offset and color,
which specify the stop offset and color respectively. The stop offset is a number between 0 and 1. It specifies the location of the color stop relative to the start point of the gradient.
0 indicates the gradient start point and 1 indicates the gradient end point. The color is expressed as "#rrggbbaa".
Example of a stops array: [{offset:0, color:"#ffffffff"}, {offset:1, color:"#ff0000ff"}]

cy float

The X offset of the gradient's center point. Must be a number between 0 and 1, where 0 indicates the left border of the gradient coordinate system.

cx float

The Y offset of the gradient's center point. Must be a number between 0 and 1, where 0 indicates the top border of the gradient coordinate system.

radius float

The radius of the gradient. The radius must be a number between 0 and 1.

stroke string

The stroke color. The string format is "#RRGGBB".

Source:
Returns:

Radial Gradient object.

Type
object

createRangedBucket(seq, low, high)

Creates a ranged bucket.

Parameters:
Name Type Description
seq int

The sequence number.

low float

The low value for this range.

high float

The high value for this range.

Source:
Returns:

RangedBucket object.

Type
object

createTextStyle(name, color, fontStyle, fontFamily, fontSize, sizeUnit, fontWeight)

Create Text Style.

Parameters:
Name Type Description
name string

The style name.

color string

Sepcifies the font color. Format is "#rrggbb".

fontStyle string

Specifies the style (italic or normal) of the font used to render the text.It should be one of two static values: OM.Text.FONTSTYLE_ITALIC or OM.Text.FONTSTYLE_NORMAL.

fontFamily string

Specifies the font family to be used to render the text.

fontSize int

Specifies the font size.

sizeUnit string

Specifies the font size unit. The value can be "pixel", "meter","kilometer", "feet", "mile". Default value is "pixel".

fontWeight int

The font weight.

Source:
Returns:

Text Style object.

Type
object

createVariableMarkerStyle(classification, color, stroke, type, textStyle, startSize, increment, numClasses, cx, cy, width, height)

Create VariableMarker Style.

Parameters:
Name Type Description
classification string

The classification scheme. Can be "equal", "logarithmic", or "custom". If it's

"equal" or "logarithmic", all buckets are generated automatically. If it's custom, then the supplied function

is invoked to generate the buckets.

color string

The fill color in rgb, i.e. in the format "#rrggbb".

stroke string

The stroke color in rgb, i.e. in the format "#rrggbb".

type string

The type of the vector shape. Valid values are "circle", "path" or "rectangle".

textStyle object

The text style will apply to the text on marker feature. use mapper. createTextStyle function.

startSize integer

The initial width/height of the marker.

increment integer

The increment width/height for each bucket.

numClasses integer

The number of buckets. Only used when the classification scheme is "equal" or "logarithmic" and hence the buckets are automatically generated.

cx integer

The initial x coor vector shape of the marker.

cy integer

The initial y coor vector shape of the marker.

width integer

The initial width vector shape of the marker.

height integer

The initial height vector shape of the marker.

Source:
Returns:

Text Style object with vectorDef.

Type
object

createVectorMarkerStyle(name, fillColor, fillOpacity, borderColor, borderOpacity, borderWidth, width, height, vector)

Create a vector marker style object.

Parameters:
Name Type Description
name string

Name of the style.

fillColor string

Filling color. A string in the format of "RRGGBB", or null if no filling.

fillOpacity int

Opacity of the fill color. Opacity value ranges from 0 (completely transparent) to 255 (completely opaque). Default value is 255.

borderColor string

Border color. A string in the format of "RRGGBB".

borderOpacity int

Opacity of the border color. Opacity value ranges from 0 (completely transparent) to 255 (completely opaque). Default value is 255.

borderWidth int

Border width in device point/pixel unit. Default is 1.

width int

Marker width in pixels.

height int

Marker height in pixels.

vector object

Sets the shape coordinates for the vector type marker. It basically supports two types of shapes: polygon/polyline and circle.
For polygon/polyline (which can be used to represent rectangle, triangle and other simple shapes), the parameter must be a series of comma separated ordinates (x1,y1,x2,y2,...). Note that for polygon/polyline shapes, the cooridnates can be in any coordinate system with arbitrary origin. LocationBox will do all the necessary transformation at the server side. For instance, the following cooridnates represent a diamond shape: "50,199,0,100,50,1,100,100,50,199" For circle type marker, the parameter must start with "c:" and followed by a single numeric value representing the radius of the cirlce, such as "c:50".

Source:
Returns:

Marker object

Type
object

createXorFilter(filter1, filter2)

This is a combo-filter class that implements the logical "XOR" operation of two filters.

Parameters:
Name Type Description
filter1 object

An instance of OM.filter.Filter can create with mapper.createFilter(filterType, attrName, filterValue).

filter2 object

An instance of OM.filter.Filter can create with mapper.createFilter(filterType, attrName, filterValue).

Source:
Returns:

new OM.filter.Xor object

Type
object

displayInfoWindow(latitude, longitude, html, width, height, title, parameters)

Display an info window at specified latitude/longitude.

Parameters:
Name Type Description
latitude float

The latitude value of the point that info window going to be displayed.

longitude float

The longitude value of the point that info window going to be displayed.

html string

An HTML content string that is going to be displayed inside the info window.

width int

The width of the info window in pixels.

height int

The height of the info window in pixels.

title string

A string that is going to be displayed at the header of the info window.

parameters object

The object that specifies the custom style parameters, which are effective only when the info window style is "MVInfoWindowStyle1".

Source:

enableLoadingIcon()

Enables to loading icon.

Source:

enableMouseWheelZooming(wheelZooming)

This method enables or disables mouse wheel zooming. When mouse wheel zooming is enabled, the user can zoom in the map by scrolling the mouse wheel forward and zoom out the map by scrolling the mouse wheel backward.

Parameters:
Name Type Description
wheelZooming boolean

A boolean that specifies whether to enable mouse wheel zooming (Default: true).

Source:

getCenterLat()

Get center latitude.

Source:
Returns:

(double) Y point.


getCenterLon()

Get center longitude.

Source:
Returns:

(double) X point.


getCircleData()

Get radius and center coordinates of the circle drawn by the circle tool.

Source:
Returns:

Radius and center coordinates of the circle drawn by the circle tool.


getCirclePolygonOrdinates()

This method returns the ordinates object that specifies a polygon that proximates the circle on the map.

Source:
Returns:

ordinates obj


getGeolocation(callback)

Get the location of user.

Parameters:
Name Type Description
callback function

Callback function.

Source:

getMapClickPosition()

Get the coordinates of point clicked on map.

Source:
Returns:

The map click position.


getMapCoordinates(x, y)

Display an info window at specified latitude/longitude.

Parameters:
Name Type Description
x number

The X ordinate in screen pixels.

y number

The Y ordinate in screen pixels.

Source:
Returns:
Type
object

getMapRectangle()

Get coordinates of the bounding box of the map window.

Source:
Returns:

Maps coordinates of object array.


getMarker(id)

Get a specified marker.

Parameters:
Name Type Description
id string

Id of the marker.

Source:
Returns:

Marker Object.

Type
object

getMaxZoomLevel()

Get maximum zoom level.

Source:
Returns:

(int) Max zoom level.


getMouseLocation()

Get coordinates of the location that mouse points.

Source:
Returns:

Mouse Location (x,y).


getPolygonOrdinates()

Get polygon ordinates.

Source:
Returns:

The list of polygon ordinates.

Type
array

getRectangleOrdinates()

Clear the Rectangle Tool.

Source:

getRedlineOrdinates()

Get an array of ordinates of the shape drawn with the red line tool.

Source:
Returns:

Ordinates of the shape drawn.


getScreenLocation(x, y)

Get the screen location for the specified ground coordinate.

Parameters:
Name Type Description
x double

X coordinate.

y double

Y coordinate.

Source:
Returns:

x and y members.


getZoomLevel()

Get zoom level.

Source:
Returns:

(int) Zoom level.


hideTrafficView()

Hide the visualized traffic data on the map.

Source:

initMap(mapCenterLat, mapCenterLon, mapZoom, pBaseMap, pUrlBase, mapDiv)

Initialize the IMapper object.

Parameters:
Name Type Description
mapCenterLat int

The latitude value of center coordinate of the map.

mapCenterLon int

The longitude value of center coordinate of the map.

mapZoom int

Initial zoom level of map (1-16).

pBaseMap int

Name of the basemap. Three types of basemap is defined in LocationBox.
IMapper.BASEMAP_TILELAYER Simple basemap displaying limited administrative data. (cities, borders)
IMapper.BASEMAP_TILELAYER_NOLOGO Basemap showing POIs represented by their own logos.
If basemap is not specified, default basemap is BASEMAP_TILELAYER.

pUrlBase int

Url of the map server. If url base is not specified, default url base is http://maplink.infotech.com.tr/mapviewer.

mapDiv int

The div to set the map. If it is null or not specified then it is set as "map".

Source:
Returns:

map object

Type
object

initMapWithExtent(minLat, minLon, maxLat, maxLon, pBaseMap, pUrlBase, mapDiv)

Initialize the IMapper object with given extent coordinates.

Parameters:
Name Type Description
minLat double

The minimum latitude extent of the map.

minLon double

The minimum longitude extent of the map.

maxLat double

The maximum latitude extent of the map.

maxLon double

The maximum longitude extent of the map.

pBaseMap string

Name of the basemap. Three types of basemap is defined in LocationBox.

IMapper.BASEMAP_SIMPLE Simple basemap displaying limited administrative data. (cities, borders)

IMapper.BASEMAP_POI Basemap showing POIs additional to administrative data. (cities, borders, roads etc.)

IMapper.BASEMAP_POI_LOGO Basemap showing POIs represented by their own logos.


If basemap is not specified, default basemap is BASEMAP_POI_LOGO.

pUrlBase string

Url of the map server.

If url base is not specified, default url base is http://www.locationbox.com.tr/mapviewer.

mapDiv string

The div to set the map. If it is null or not specified then it is set as "map".

Source:
Returns:

map object.

Type
object

moveMarker(id, latitude, longitude, zindex)

Update the marker with given id and set latitude, longitude and z-index values to that marker.

Parameters:
Name Type Description
id string

Id of the marker.

latitude float

The latitude value of the point.

longitude float

The longitude value of the point.

zindex int

This method sets the z-index (display order) value of the marker group. The group with a larger z-index value is displayed above the group with a smaller z-index value.

Source:

mvAfterZoom()

Adds Traffic Theme if not exist.

Source:

mvBeforeZoom()

Removes Traffic Theme if exist.

Source:

pan(offX, offY)

Pan (move) the map by the specified X and Y offset.

Parameters:
Name Type Description
offX number

The X offset in screen pixels.

offY number

The Y offset in screen pixels.

Source:

print(callback)

Print the map being viewed.

Parameters:
Name Type Description
callback function

The user defined function that is called when the server returns the map image URL. The map image URL is passed as the only parameter to this function.

Source:

removeBingTileLayer()

Remove Bing Tile Layer from the map.

Source:

removeEarthquakes()

Remove Earthquakes to the map.

Source:

removeFeature(id)

Remove an added feature by specifying its id.

Parameters:
Name Type Description
id string

Id of the feature.

Source:

removeGoogleTileLayer()

Remove Google Tile Layer from the map.

Source:

removeImageLayer()

Remove image layer from map.

Source:

removeInfoWindow()

Remove the existing info window.

Source:

removeLabelFromMarker(id)

Remove the label from a specified marker.

Parameters:
Name Type Description
id string

Id of the marker.

Source:

removeMapDecoration()

Remove the map decoration by specifying its id.

Source:

removePharmacyOnDuty()

Remove pharmacy on duty layer from the map.

Source:

removePoiList(id)

Remove poi list from the map.

Parameters:
Name Type Description
id string

The id of POI list.

Source:

removeRoute(id)

Remove an existing route path from the map.

Parameters:
Name Type Description
id string

Id of the route object.

Source:

removeSocialEvents()

Remove social events from the map.

Source:

removeTileLayer(tileLayer)

Parameters:
Name Type Description
tileLayer string

Remove a specified TileLayer from the map. The layer-deleted event will be fired.

Source:

removeToolFeature(id)

Registers that feature is removed.

Parameters:
Name Type Description
id key

Feature key.

Source:
Returns:

an edit change event object (EditChangeEvent).

Type
object

removeTrafficEvents()

Remove the traffic event data from the map.

Source:

removeTrafficTmc()

Remove Traffic TMC from the map

Source:

removeWeatherReport()

Remove weather report layer from the map.

Source:

removeYolList(id)

Remove yol list to the map.

Parameters:
Name Type Description
id string

Id of YolList.

Source:

setCircleTool(getCircle, getDragEvent)

Initialize the circle tool.

Parameters:
Name Type Description
getCircle function

The user defined function that is called when a map event is fired.

getDragEvent function

The user defined function that is called when a map event is fired.

Source:

setMapListener(event, callback)

Initialize map listener.

Parameters:
Name Type Description
event string

Name of the event being listened.

callback function

The user defined function that is called when a map event is fired.

Source:

setMarkerListener(id, event, callback)

Set marker listener.

Parameters:
Name Type Description
id string

Id of the marker.

event object

Types of events.

IMapper.MARKER_MOUSE_CLICK

IMapper.MARKER_MOUSE_OVER

IMapper.MARKER_MOUSE_OUT

IMapper.MARKER_MOUSE_RIGHT_CLICK

callback function

The user defined function that is called when marker is set.

Source:

setMarkerVisible(id, visible)

Set Marker Visible.

Parameters:
Name Type Description
id int

The id of marker.

visible boolean

Visibility of the marker.

Source:

setMeasureTool(getNewPoint, getNewLine, finishMode, simplified)

This is a sub class of OM.tool.Tool that can be used to draw arbitrary shape(s) on the map. It is similar to the traditional red-lining function.

Parameters:
Name Type Description
getNewPoint object

callback for OM.event.ToolEvent.REDLINE_POINT_CREATE listener.

getNewLine object

callback for OM.event.ToolEvent.TOOL_END listener.

finishMode boolean

default is OM.tool.Redline.FINISH_ON_CLICK, meaning you must click on the initial polygon vertex once to finish/complete the tool's drawing operation. If set to OM.tool.Redline.FINISH_ON_RELEASE, then
the tool will complete the drawing on the very first mouse-up.

simplified boolean

default is true. true: simplify the result of the redline; false: not simplify the result of redline.

Source:

setPolygonOrdinates(ordinates)

Draw polygon by using the given ordinates.

Parameters:
Name Type Description
ordinates array

The list of ordinates.

Source:

setPolygonTool()

Enables Polygon tool if not exist.

Source:

setRectangleTool()

Initialize the Rectangle Tool.

Source:

setRedlineTool(polygonEndAction, polygonEditAction)

Initialize the red line tool.

Parameters:
Name Type Description
polygonEndAction function

The user defined function that is called when a map event is fired.

polygonEditAction function

The user defined function that is called when a map event is fired.

Source:

showMapCentered(mapCenterLat, mapCenterLon, mapZoom)

Show map defined by its center point.

Parameters:
Name Type Description
mapCenterLat double

The latitude value of center coordinate of the map.

mapCenterLon double

The longitude value of center coordinate of the map.

mapZoom int

Initial zoom level of map (1-14).

Source:

showMapRectangle(minLat, minLon, maxLat, maxLon)

Show map defined by a bounding rectangle.

Parameters:
Name Type Description
minLat int

The latitude value of upper left corner coordinate of the rectangle.

minLon int

The longitude value of upper left corner coordinate of the rectangle.

maxLat int

The latitude value of lower right corner coordinate of the rectangle.

maxLon int

The longitude value of lower right corner coordinate of the rectangle.

Source:

showTrafficView(zindex, mapDiv)

Show the visualized traffic data on the map.

There are 4 grades of traffic density represented by 4 colors:

Light Green: Little or no traffic density. No delay.

Dark Green: Increasing traffic density. Slight delay.

Orange: Increased traffic density.

Red: Traffic jam.

Parameters:
Name Type Description
zindex int

This method sets the z-index (display order) value of the marker group. The group with a larger z-index value is displayed above the group with a smaller z-index value.

mapDiv string

The div to set the map. If it is null or not specified then it is set as "map".

Source:

startMarqueeZoom()

Initialize marquee zoom tool.

Source:

stopMarkerFlowAnimation(tmcKod)

Stop Marker Flow Animation.

Parameters:
Name Type Description
tmcKod string

TMC code.

Source:

stopMarqueeZoom()

Initialize marquee zoom tool.

Source:

xml2json()

Parse xml data to convert into json format.

Source:
Returns:

Json object.


zoomIn()

Zoom in by one level.

Source:

zoomLevel(mapZoom)

Set zoom level.

Parameters:
Name Type Description
mapZoom int

Zoom level. Takes an integer value from 1 to 8.

Source:

zoomOut()

Zoom out by one level.

Source:

zoomToLayer(id)

Zooms to a layer.

Parameters:
Name Type Description
id string

Name of layer theme.

Source:

zoomToMarkers(list)

Zoom to the area bounded by multiple markers.

Parameters:
Name Type Description
list string

Id list of markers as a single string, separated by comma (,).

Source: