|
Revision 1932, 1.8 kB
(checked in by fvanderbiest, 6 months ago)
|
Measure ux: we do not include OpenLayers classes for now
|
| Line | |
|---|
| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
Ext.namespace("GeoExt.ux") |
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 |
GeoExt.ux.Measure.Position = Ext.extend(GeoExt.ux.Measure, { |
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 |
|
|---|
| 31 |
|
|---|
| 32 |
constructor: function(config) { |
|---|
| 33 |
var scope = {decimals: config.decimals || 2}; |
|---|
| 34 |
|
|---|
| 35 |
Ext.applyIf(config, { |
|---|
| 36 |
iconCls: 'gx-map-measureposition', |
|---|
| 37 |
tooltip: "Position measurement" |
|---|
| 38 |
}); |
|---|
| 39 |
|
|---|
| 40 |
arguments.callee.superclass.constructor.call(this, |
|---|
| 41 |
OpenLayers.Handler.Point, config); |
|---|
| 42 |
|
|---|
| 43 |
if (this.control.map.units == 'degrees' || this.control.map.units == 'dd') { |
|---|
| 44 |
this.template = new Ext.XTemplate( |
|---|
| 45 |
'<p>{["lon: "+values.geometry.x.toFixed(this.decimals) + "°"]}</p>'+ |
|---|
| 46 |
'<p>{["lat: "+values.geometry.y.toFixed(this.decimals) + "°"]}</p>', |
|---|
| 47 |
scope); |
|---|
| 48 |
} else { |
|---|
| 49 |
this.template = new Ext.XTemplate( |
|---|
| 50 |
'<p>{["X: "+values.geometry.x.toFixed(this.decimals) '+ |
|---|
| 51 |
'+ " " + values.units]}</p>'+ |
|---|
| 52 |
'<p>{["Y: "+values.geometry.y.toFixed(this.decimals) '+ |
|---|
| 53 |
'+ " " + values.units]}</p>', |
|---|
| 54 |
scope); |
|---|
| 55 |
} |
|---|
| 56 |
this.template.compile(); |
|---|
| 57 |
} |
|---|
| 58 |
}); |
|---|