1: <?php
2:
3: namespace Mapbender\CoreBundle\Element;
4:
5: use Mapbender\CoreBundle\Component\Element;
6:
7: 8: 9: 10: 11:
12: class ScaleBar extends Element
13: {
14:
15: 16: 17:
18: static public function getClassTitle()
19: {
20: return "ScaleBar";
21: }
22:
23: 24: 25:
26: static public function getClassDescription()
27: {
28: return "";
29: }
30:
31: 32: 33:
34: static public function getClassTags()
35: {
36: return array('ScaleBar', "Map's scale bar");
37: }
38:
39: 40: 41:
42: public static function getDefaultConfiguration()
43: {
44: return array(
45: 'title' => 'Scale Bar',
46: 'tooltip' => 'Scale Bar',
47: 'target' => null,
48: 'maxWidth' => 200,
49: 'anchor' => 'right-bottom',
50: 'units' => array("km"));
51: }
52:
53: 54: 55:
56: public function getWidgetName()
57: {
58: return 'mapbender.mbScalebar';
59: }
60:
61: 62: 63:
64: public static function getType()
65: {
66: return 'Mapbender\CoreBundle\Element\Type\ScaleBarAdminType';
67: }
68:
69: 70: 71:
72: public static function getFormTemplate()
73: {
74: return 'MapbenderManagerBundle:Element:scalebar.html.twig';
75: }
76:
77: 78: 79:
80: public function getAssets()
81: {
82: return array(
83: 'js' => array('mapbender.element.scalebar.js'),
84:
85: 'css' => array());
86: }
87:
88: 89: 90:
91: public function render()
92: {
93: return $this->container->get('templating')
94: ->render('MapbenderCoreBundle:Element:scalebar.html.twig',
95: array(
96: 'id' => $this->getId(),
97: "title" => $this->getTitle(),
98: 'configuration' => $this->getConfiguration()));
99: }
100:
101: }
102:
103: