1: <?php
2:
3: namespace Mapbender\CoreBundle\Element;
4:
5: use Mapbender\CoreBundle\Component\Element;
6:
7: 8: 9: 10: 11: 12: 13: 14:
15: class CoordinatesDisplay extends Element
16: {
17:
18: 19: 20:
21: public static function getClassTitle()
22: {
23: return 'Coordinates Display';
24: }
25:
26: 27: 28:
29: public static function getClassDescription()
30: {
31: return 'The coordinates display shows your mouse position in map coordinates.';
32: }
33:
34: 35: 36:
37: public static function getClassTags()
38: {
39: return array('coordinates', 'display', 'mouse', 'position');
40: }
41:
42: 43: 44:
45: public static function getType()
46: {
47: return 'Mapbender\CoreBundle\Element\Type\CoordinatesDisplayAdminType';
48: }
49:
50: 51: 52:
53: public function getAssets()
54: {
55: return array(
56: 'js' => array('mapbender.element.coordinatesdisplay.js'),
57: 'css' => array()
58: );
59: }
60:
61: 62: 63:
64: public static function getDefaultConfiguration()
65: {
66: return array(
67: 'tooltip' => 'coordinates display',
68: 'anchor' => 'right-bottom',
69: 'label' => false,
70: 'numDigits' => 2,
71: 'empty' => 'x= - y= -',
72: 'prefix' => 'x= ',
73: 'separator' => ' y= ',
74: 'target' => null
75: );
76: }
77:
78: 79: 80:
81: public function getWidgetName()
82: {
83: return 'mapbender.mbCoordinatesDisplay';
84: }
85:
86: 87: 88:
89: public function render()
90: {
91: $a = $this->getConfiguration();
92: return $this->container->get('templating')
93: ->render('MapbenderCoreBundle:Element:coordinatesdisplay.html.twig',
94: array(
95: 'id' => $this->getId(),
96: 'title' => $this->getTitle(),
97: 'configuration' => $this->getConfiguration()));
98: }
99:
100: 101: 102:
103: public static function getFormTemplate()
104: {
105: return 'MapbenderManagerBundle:Element:coordinatesdisplay.html.twig';
106: }
107: }
108:
109: