diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2017-03-31 10:11:32 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2017-03-31 10:11:32 +0100 |
commit | 3d967f09d8171b283c9a90afa6407dc033e4ae42 (patch) | |
tree | 6ee61d6ae0ec96dfe9444a45bd773d9030283415 /web/js | |
parent | c1346b93ee2dd21ec501484da89aa28350631960 (diff) | |
parent | 7032edb7a72758086fcaa3e3d0b198a163cf043c (diff) |
Merge branch 'dominican-republic-improvements'
Diffstat (limited to 'web/js')
-rw-r--r-- | web/js/map-OpenLayers.js | 2 | ||||
-rw-r--r-- | web/js/map-google-ol.js | 18 |
2 files changed, 19 insertions, 1 deletions
diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js index 2a5af940d..40539f385 100644 --- a/web/js/map-OpenLayers.js +++ b/web/js/map-OpenLayers.js @@ -331,6 +331,8 @@ var fixmystreet = fixmystreet || {}; ); $("#problem_northing").text(bng.y.toFixed(1)); $("#problem_easting").text(bng.x.toFixed(1)); + $("#problem_latitude").text(lonlat.y.toFixed(6)); + $("#problem_longitude").text(lonlat.x.toFixed(6)); $("form#report_inspect_form input[name=latitude]").val(lonlat.y); $("form#report_inspect_form input[name=longitude]").val(lonlat.x); }, diff --git a/web/js/map-google-ol.js b/web/js/map-google-ol.js index 96ec6fe9b..7369a8e9f 100644 --- a/web/js/map-google-ol.js +++ b/web/js/map-google-ol.js @@ -33,8 +33,24 @@ fixmystreet.maps.config = function() { zoomDuration: 10 }; + var road_layer = {}; // Empty object defaults to standard road layer + + function apply_map_styles() { + var styledMapType = new google.maps.StyledMapType(fixmystreet_google_maps_custom_style); + this.mapObject.mapTypes.set('styled', styledMapType); + this.mapObject.setMapTypeId('styled'); + } + // If you want to apply a custom style to the road map (for example from + // a service such as snazzymaps.com) then define that style as a top-level + // variable called fixmystreet_google_maps_custom_style (you might have to + // override the maps/google-ol.html template to include your own JS file) + // and it'll automatically be applied. + if (typeof fixmystreet_google_maps_custom_style !== 'undefined') { + road_layer = { type: 'styled', eventListeners: { added: apply_map_styles } }; + } + fixmystreet.layer_options = [ - {}, + road_layer, { type: google.maps.MapTypeId.HYBRID } ]; }; |