5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
# File 'app/controllers/apps_controller.rb', line 5
def show
@current_roles = current_roles.roles.collect(&:name)
@topic_name = params['topic'] || DEFAULT_TOPIC[@zone].name
@back_topic_name = params['back'].nil? ? nil : params['back']
@over_topic_name = params['over'].blank? ? '[]' : params['over'].split(',').to_json
@main_default_topic = DEFAULT_TOPIC[@zone].name
@offlayers = params['offlayers'].blank? ? [] : params['offlayers'].split(',')
@scale = params['scale'].nil? ? DEFAULT_SCALE : params['scale'].to_i
@x = params['x'].nil? ? DEFAULT_X : params['x'].to_f
@y = params['y'].nil? ? DEFAULT_Y : params['y'].to_f
@client_srid = params[:srid].blank? ? GeoModel.default_client_srid : params[:srid].to_i
@zoom = params['zoom'].nil? ? DEFAULT_ZOOM : params['zoom'].to_i @gbapp = params['gbapp'].nil? ? 'default' : params['gbapp']
@seltopic = params['seltopic']
@sellayer = params['sellayer']
@selproperty = params['selproperty']
@selvalues = params['selvalues'].nil? ? [] : params['selvalues'].split('$')
@filt_topic = params['filttopic']
@filt_param = params['filtparam']
@filt_values = params['filtvalues'].nil? ? [] : params['filtvalues'].split('$')
@filt_typestring = params['filttypestring'].nil? ? 0 : params['filttypestring']
@redlining = params['redlining'].blank? ? nil : params['redlining']
@centermarker = params['centermarker']
@markers = params['markers']
if params['locate']
rule = LOCATERULES[params['locate']]
if rule.nil?
logger.info "Locate rule not found: {params['locate']}"
else
location = rule.locate(params['locations'], @client_srid)
unless location.nil?
@seltopic = location[:selection][:topic] || @topic_name
@sellayer = location[:selection][:layer]
@selproperty = location[:selection][:property]
@selvalues = location[:selection][:values]
@selscalerange = location[:selection][:scalerange]
@x = location[:x]
@y = location[:y]
@scale = params['scale'].nil? ? location[:scale] : params['scale'].to_i
@selbbox = location[:bbox]
else
logger.info "no features found."
end
end
end
@selection_valid = !(@seltopic.nil? || @sellayer.nil? || @selproperty.nil? || @selvalues.empty?)
@app = params[:app]
session[:map_ts] = Time.now
render :action => @app, :layout => false
end
|