Class: MapLayers::Feature

Inherits:
Struct
  • Object
show all
Defined in:
lib/map_layers/feature.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#geometryObject

Returns the value of attribute geometry


4
5
6
# File 'lib/map_layers/feature.rb', line 4

def geometry
  @geometry
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id


3
4
5
# File 'lib/map_layers/feature.rb', line 3

def id
  @id
end

#textObject

Returns the value of attribute text

Returns:

  • (Object)

    the current value of text


3
4
5
# File 'lib/map_layers/feature.rb', line 3

def text
  @text
end

#xObject

Returns the value of attribute x

Returns:

  • (Object)

    the current value of x


3
4
5
# File 'lib/map_layers/feature.rb', line 3

def x
  @x
end

#yObject

Returns the value of attribute y

Returns:

  • (Object)

    the current value of y


3
4
5
# File 'lib/map_layers/feature.rb', line 3

def y
  @y
end

Class Method Details

.from_geom(text, geom, id = nil) ⇒ Object


5
6
7
8
9
# File 'lib/map_layers/feature.rb', line 5

def self.from_geom(text, geom, id = nil)
  f = new(text, geom.x, geom.y, id)
  f.geometry = geom
  f
end