new HexGrid( [options])
Hexagonal grids
Parameters:
| Name | Type | Argument | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| options | olx.HexGrid | <optional> | Properties
 | 
Extends
- ol.Object
Members
- 
    layout
- 
    
    Layout 
Methods
- 
    coord2hex(coord)
- 
    
    Convert coord to hex Parameters:Name Type Description coordol.coord Returns:- Type
- ol.hex
 
- 
    cube2hex(c)
- 
    
    Convert cube to axial coords Parameters:Name Type Description col.coordinate cube coordinate Returns:axial coordinate - Type
- ol.coordinate
 
- 
    cube_distance(a, a)
- 
    
    Calculate distance between to hexagon (number of cube) Parameters:Name Type Description aol.coordinate first cube coord aol.coordinate second cube coord Returns:distance - Type
- Number
 
- 
    cube_line(a, b)
- 
    
    Calculate line between to hexagon Parameters:Name Type Description aol.coordinate first cube coord bol.coordinate second cube coord Returns:array of cube coordinates - Type
- Array.<ol.coordinate>
 
- 
    cube_neighbors(c, direction)
- 
    
    Get the neighbors for an hexagon Parameters:Name Type Description col.coordinate cube coord directionNumber Returns:neighbor || array of neighbors - Type
- ol.coordinate | Array.<ol.coordinates>
 
- 
    cube_round(c, o, h)
- 
    
    Convert offset to cube coords Parameters:Name Type Description col.coordinate cube coordinate ool.coordinate offset coordinate hol.coordinate cube coordinate Returns:- 
offset coordinate / ol.HexGrid.prototype.cube2offset = function(c) { return hex2offset(cube2hex(c)); }; /** Convert cube to offset coords - Type
- ol.coordinate
 
- 
cube coordinate / ol.HexGrid.prototype.offset2cube = function (o) { return hex2cube(offset2Hex(o)); }; /** Round cube coords - Type
- ol.coordinate
 
- 
rounded cube coordinate - Type
- ol.coordinate
 
 
- 
- 
    getHexagon(hex)
- 
    
    Get hexagon coordinates at hex Parameters:Name Type Description hexol.coord Returns:- Type
- Arrary.<ol.coord>
 
- 
    getHexagonAtCoord(coord)
- 
    
    Get hexagon coordinates at a coordinate Parameters:Name Type Description coordol.coord Returns:- Type
- Arrary.<ol.coord>
 
- 
    getLayout()
- 
    
    Get layout Returns:layout name - Type
- pointy | flat
 
- 
    getOrigin()
- 
    
    Get hexagon origin Returns:coord origin - Type
- ol.coordinate
 
- 
    getSize()
- 
    
    Get hexagon size Returns:hexagon size - Type
- Number
 
- 
    hex2coord(hex)
- 
    
    Convert hex to coord Parameters:Name Type Description hexol.hex Returns:- Type
- ol.coord
 
- 
    hex2cube(h)
- 
    
    Convert axial to cube coords Parameters:Name Type Description hol.coordinate axial coordinate Returns:cube coordinate - Type
- ol.coordinate
 
- 
    hex2offset(h)
- 
    
    Convert offset to axial coords Parameters:Name Type Description hol.coordinate axial coordinate Returns:offset coordinate - Type
- ol.coordinate
 
- 
    hex_corner()
- 
    
    Get hexagon corners 
- 
    hex_neighbors(h, direction)
- 
    
    Get the neighbors for an hexagon Parameters:Name Type Description hol.coordinate axial coord directionNumber Returns:neighbor || array of neighbors - Type
- ol.coordinate | Array.<ol.coordinates>
 
- 
    hex_round(h)
- 
    
    Round axial coords Parameters:Name Type Description hol.coordinate axial coordinate Returns:rounded axial coordinate - Type
- ol.coordinate
 
- 
    offset2hex(o)
- 
    
    Convert axial to offset coords Parameters:Name Type Description ool.coordinate offset coordinate Returns:axial coordinate - Type
- ol.coordinate
 
- 
    setLayout(layout)
- 
    
    Set layout Parameters:Name Type Description layoutpointy | flat | undefined name, default pointy 
- 
    setOrigin(coord)
- 
    
    Set hexagon origin Parameters:Name Type Description coordol.coordinate origin 
- 
    setSize(hexagon)
- 
    
    Set hexagon size Parameters:Name Type Description hexagonNumber size 
 ol-ext
ol-ext