CanvasMap
Getting Started Tutorials 3D Reference

Class CM2Layer extends CMLayer

CM2Layer
This class is the base class for all other layers. This class contains functions and properties for feature and raster based
classes. This is because the CMLayerPyramid supports both raster and vector data. This also may be a trend with data formats like KML.

Adds:
- Zooming: Min, Max, To Bounds
- Metadata
- InfoText popup balloon
- Painting Marks, labels, and icon images for point data
- Mouse over and selected styles
- Settings for features
- Getting and setting attributes
- Bounds of features


Copyright (C) 2020, Humboldt State University, Jim Graham

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General
Public License as published by the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see
.

Settings Group: Mark

Setting Name Type Options Default Comments
Type Type CMTYPE_ENUMERATED CMMARK_CIRCLE, CMMARK_TRIANGLE, CMMARK_SQUARE, CMMARK_STAR CMMARK_CIRCLE
Size Size CMTYPE_FLOAT 3
SizeInMapUnits Size In Map Units CMTYPE_BOOLEAN size the mark as the user zooms in and out

Settings Group: IconImage

Setting Name Type Options Default Comments
URL URL CMTYPE_URL
TheImage Image CMTYPE_IMAGE null
OffsetX Offset X CMTYPE_FLOAT 0
OffsetY Offset Y CMTYPE_FLOAT 0

Settings Group: LabelBox

Setting Name Type Options Default Comments
Location Location CMTYPE_INDEXES CMLABEL_LOCATIONS, Default:CMLABEL_TOP_RIGHT CMLABEL_TOP_RIGHT
OffsetX Offset X CMTYPE_FLOAT 0
OffsetY Offset Y CMTYPE_FLOAT 0
Padding Padding CMTYPE_FLOAT 2

LabelStyle Label Style CMTYPE_OBJECT null standard HTML 5 settings except the defaults may change MouseOverStyle Mouse Over Style CMTYPE_OBJECT standard HTML 5 settings SelectedStyle Selected Style CMTYPE_OBJECT null standard HTML 5 settings

Static Functions

ReturnsFunctionThrows
PaintMark()

Object Functions

Inherited From: CMLayer
ReturnsFunctionThrows
SetIconImage(TheURL, OffsetX, OffsetY)
SetFeatureIconImage(TheURL, OffsetX, OffsetY)

Static Functions

PaintMark()

Utility function to draw a mark. Used by the layers and by the settings dialogs
jjg - might want to change this to be Pixel based to remove number of convertions.

Object Functions

SetIconImage(TheURL, OffsetX, OffsetY)

Icon for point features

Parameters:
    TheURL - the URL of the image to use for all features
    OffsetX - horizontal offset in pixels to go from the upper left of the image to the hot spot
    OffsetY - vertical offset in pixels to go from the upper left of the image to the hot spot

SetFeatureIconImage(TheURL, OffsetX, OffsetY)

Icon for point features

Parameters:
    TheURL - the URL of the image to use for all features
    OffsetX - horizontal offset in pixels to go from the upper left of the image to the hot spot
    OffsetY - vertical offset in pixels to go from the upper left of the image to the hot spot