Skip to content

Commit

Permalink
LocationSelector should respect deployment_setting to show latlon if not
Browse files Browse the repository at this point in the history
set explictly. Modify setting to default to Off for
backwards-compatibility of new selector.
Magnu: Enable latlon selector
CRMT2: bugfix layer_wms
  • Loading branch information
flavour committed Dec 16, 2014
1 parent 2542346 commit aa43789
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
28d35a9 (2014-12-15 13:01:28)
2542346 (2014-12-16 10:05:51)
7 changes: 4 additions & 3 deletions modules/s3/s3widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -2961,7 +2961,6 @@ def __call__(self, field, value, **attributes):
class S3LocationLatLonWidget(FormWidget):
"""
Renders a Lat & Lon input for a Location
"""

def __init__(self, empty=False):
Expand Down Expand Up @@ -4123,7 +4122,7 @@ def __init__(self,
reverse_lx = False,
show_address = False,
show_postcode = False,
show_latlon = False,
show_latlon = None,
latlon_mode = "decimal",
latlon_mode_toggle = True,
show_map = True,
Expand Down Expand Up @@ -4177,10 +4176,12 @@ def __init__(self,
self.show_address = show_address
self.show_postcode = show_postcode

# @todo: latlon_toggle_mode should default to a deployment setting
if show_latlon is None:
show_latlon = current.deployment_settings.get_gis_latlon_selector()
self.show_latlon = show_latlon
self.latlon_mode = latlon_mode
if show_latlon:
# @todo: latlon_toggle_mode should default to a deployment setting
self.latlon_mode_toggle = latlon_mode_toggle
else:
self.latlon_mode_toggle = False
Expand Down
2 changes: 1 addition & 1 deletion modules/s3cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,7 @@ def get_gis_latlon_selector(self):
"""
Display Lat/Lon form fields when selecting Locations
"""
return self.gis.get("latlon_selector", True)
return self.gis.get("latlon_selector", False)

def get_gis_layer_metadata(self):
"""
Expand Down
2 changes: 1 addition & 1 deletion private/templates/CRMT2/gis_layer_wms.csv
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Vehicle Ownership,"Percentage of households which don't have access to a vehicle
White non-Hispanic,Percentage of population which is White and not Hispanic or Latino: DP0110011/DP0110001,2010 Census,http://www.census.gov/2010census/,http://lacrmt.sahanafoundation.org:8080/geoserver/lacrmt/wms,white,Census Data/Ethnicity,True,False,False,True,0.4,image/png,True,True,
Flood Zones,FEMA FIRM (Flood Insurance Rate Maps) from 2013-04-16,FEMA Flood Zones,http://dpw.lacounty.gov/wmd/floodzone/,http://lacrmt.sahanafoundation.org:8080/geoserver/lacrmt/wms,flood,Hazards,True,False,False,True,0.4,image/png,True,True,"<p dir='ltr' style='line-height:1.15;margin-top:0pt;margin-bottom:0pt;'><strong>MAP NAME</strong>: FEMA Flood Zones<br /><br /><strong>MAP SOURCE</strong>: FEMA FIRM (Flood Insurance Rate Maps)<br /><br /><strong>WHEN DID WE ADD THIS MAP?</strong>: 4-16-2013<br /><br /><strong>COULD THERE BE AN UPDATE?</strong>: FEMA may change these maps, but usually only once a decade or less often.&nbsp; FEMA updates the flood maps from time to time, for two main reasons. The flooding can change as people alter a landscape with paved roads, buildings, drainage systems.&nbsp; Experts can improve their flood estimates when they get new, improved information about ground elevation.<br /><br /><strong>WHAT DOES THIS MAP SHOW ME?</strong><br />This map shows areas that could flood in a long or intense storm. There are three layers.<br />&ldquo;More likely&rdquo; flood zones have a 1% chance of flooding in any year. This may not sound like a high chance, but these are areas that flood often enough that the government requires flood insurance and Los Angeles County building permits have special requirements.<br />&ldquo;Less likely&rdquo; flood zones have a 0.2% chance of flooding in any year. It is hard to know what to do with a percentage like this. The important points are:<br />* the 1% zones flood more often that the 0.2% zones<br />* floods in the 0.2% zones tend to be larger and more severe<br /><br /><strong>TO LEARN MORE ABOUT THIS KIND OF MAP</strong>:<br />Go to the FEMA Flood Insurance Rate Map (FIRM) website: <a href='http://www.fema.gov/floodplain-management/flood-insurance-rate-map-firm'>http://www.fema.gov/floodplain-management/flood-insurance-rate-map-firm</a><br /><br /><strong>DATA SOURCE</strong><br /><a href='http://dpw.lacounty.gov/wmd/floodzone/'>http://dpw.lacounty.gov/wmd/floodzone/</a></p>"
Landslide Susceptibility,,California Geological Survey,ftp://ftp.consrv.ca.gov/pub/dmg/rgmp/MS58/Susdata.zip,http://lacrmt.sahanafoundation.org:8080/geoserver/lacrmt/wms,laco_suscep,Hazards,True,False,False,True,0.4,image/png,True,True,
Quaternary Faults,"Quaternary fault and fold database, U.S. Geological Survey and California Geological Survey 2006",http://earthquake.usgs.gov/hazards/qfaults/,http://lacrmt.sahanafoundation.org:8080/geoserver/lacrmt/wms,quaternaryfaults,Hazards,True,False,False,True,0.4,image/png,True,True,"Every person and every place in southern California needs to be ready for powerful and damaging earthquake shaking, which could occur at any moment. Knowing where the faults are is not the most relevant information when trying to understand your earthquake risk, because a large earthquake can affect distant locations with prolonged ground shaking. A fault that is many miles away can affect you. Also, there may be faults near you that have not yet been discovered."
Quaternary Faults,"Quaternary fault and fold database, U.S. Geological Survey and California Geological Survey 2006",USGS,http://earthquake.usgs.gov/hazards/qfaults/,http://lacrmt.sahanafoundation.org:8080/geoserver/lacrmt/wms,quaternaryfaults,Hazards,True,False,False,True,0.4,image/png,True,True,"Every person and every place in southern California needs to be ready for powerful and damaging earthquake shaking, which could occur at any moment. Knowing where the faults are is not the most relevant information when trying to understand your earthquake risk, because a large earthquake can affect distant locations with prolonged ground shaking. A fault that is many miles away can affect you. Also, there may be faults near you that have not yet been discovered."
Tsunami Indundation,Potential Tsunami Indundation Area,California Geological Survey,http://www.quake.ca.gov/gmaps/WH/tsunamimaps.htm,http://lacrmt.sahanafoundation.org:8080/geoserver/lacrmt/wms,tsunami,Hazards,True,False,False,True,0.4,image/png,True,True,
"Northridge, 1994",Actual Earthquake,USGS,http://earthquake.usgs.gov/earthquakes/shakemap/sc/shake/Northridge,http://lacrmt.sahanafoundation.org:8080/geoserver/lacrmt/wms,northridge,Hazards/Earthquake Historical Events,True,False,False,True,0.4,image/png,True,True,
"San Fernando, 1971",Actual Earthquake,USGS,http://earthquake.usgs.gov/earthquakes/shakemap/sc/shake/San_Fernando,http://lacrmt.sahanafoundation.org:8080/geoserver/lacrmt/wms,san_fernando,Hazards/Earthquake Historical Events,True,False,False,True,0.4,image/png,True,True,
Expand Down
2 changes: 2 additions & 0 deletions private/templates/Magnu/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
# NB This can also be over-ridden for specific contexts later
# e.g. Activities filtered to those of parent Project
settings.gis.countries = ("CF",) # Initially, will change
# Show LatLon boxes in the Location Selector
settings.gis.latlon_selector = True
# Uncomment to display the Map Legend as a floating DIV
settings.gis.legend = "float"
# Uncomment to Disable the Postcode selector in the LocationSelector
Expand Down
4 changes: 2 additions & 2 deletions private/templates/default/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,8 @@
#settings.gis.geocode_imported_addresses = "google"
# Hide the Map-based selection tool in the Location Selector
#settings.gis.map_selector = False
# Hide LatLon boxes in the Location Selector
#settings.gis.latlon_selector = False
# Show LatLon boxes in the Location Selector
#settings.gis.latlon_selector = True
# Use Building Names as a separate field in Street Addresses?
#settings.gis.building_name = False
# Use a non-default fillColor for Clustered points
Expand Down

0 comments on commit aa43789

Please sign in to comment.