Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
jwhaney committed Jun 6, 2019
2 parents 710d193 + 1750edb commit 7ca02fc
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 23 deletions.
2 changes: 1 addition & 1 deletion lakegallery/lakegallery/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
handler500 = 'map.views.server_error'

urlpatterns = [
url(r'^', include('map.urls')),
url(r'^api/', include(router.urls)),
# disabled browsable api authentication since nothing is editable
# url(r'^api-auth/', include('rest_framework.urls',
# namespace='rest_framework')),
url(r'^admin/', admin.site.urls),
url(r'^', include('map.urls'))
]
12 changes: 9 additions & 3 deletions lakegallery/map/templates/map/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ <h4 style="text-align:left;">
if (window.innerWidth > 991) {
// bind popup content to layer
layer.bindPopup(
`<p style="text-align:center;">Click the <strong>${feature.properties.res_lbl}</strong> polygon to view the story</p>`
`<p style="text-align:center;">Click <strong>${feature.properties.res_lbl}</strong><br /> to view the story.</p>`
);
// on hover lake polygon, show popup at cursor
layer.on('mouseover', function (e) {
Expand Down Expand Up @@ -204,15 +204,21 @@ <h4 style="text-align:left;">
});
lakeClusters.addLayer(pointLayer);
map.addLayer(lakeClusters);

// set max zoom level
map.options.minZoom = map.getZoom();

// set max bounds to lakeBounds so user can't pan outside of lake area
// padding added to bounds so max is not too restrictive
map.setMaxBounds(bounds.pad(0.1));
});

// on map zoom, if zoom level greater than 9 use poly sql; else use point sql
map.on('zoomend', function() {
var zoomLevel = map.getZoom();
console.log(zoomLevel);

map.removeLayer(polyLayer);

if (zoomLevel > 9) {
$.getJSON(polyUrl, function(data) {
polyLayer = L.geoJson(data, {
Expand Down
6 changes: 0 additions & 6 deletions lakegallery/map/templates/map/story.html
Original file line number Diff line number Diff line change
Expand Up @@ -349,11 +349,9 @@ <h4 id="{{ story.section_three_nav|cut:' ' }}">{{ story.section_three_header }}<
basemaps['Google Imagery'].addTo(map);

var account = 'tnris-flood';
// var static_url = "{% static 'map/images/' %}";

var resConfig = JSON.parse('{{ layer }}'.replace(/&#39;/g, '"').replace(/&quot;/g, "'"));
var linkConfig = JSON.parse('{{ links }}'.replace(/&#39;/g, '"'));
// var overlayQueryId = "{{ overlay_query }}";

// begin getLakeJson function - config & lakeName as args
function getLakeJson (config, lakeName) {
Expand Down Expand Up @@ -407,9 +405,7 @@ <h4 id="{{ story.section_three_nav|cut:' ' }}">{{ story.section_three_header }}<
});

var len = ticks.length;
// labelObject[len] = `<a href="https://tnris.org/texas-imagery-service/" target="_blank" title="Texas Imagery Service">Current</a>`;
labelObject[len] = `<a href="https://tnris.org/texas-imagery-service/" class="historical-link" target="_blank" title="Texas Imagery Service">Current</a>`;
// labelObject[len] = `<a href="https://tnris.org/texas-imagery-service/" target="_blank" title="Google Texas Imagery Service"><img src="{% static 'map/images/google-22px.png' %}"</img></a>`;
ticks.push(len);

// create labels for time slider with links to datahub historical imagery (future enhancement)
Expand Down Expand Up @@ -563,8 +559,6 @@ <h4 id="{{ story.section_three_nav|cut:' ' }}">{{ story.section_three_header }}<
});
});

// console.log($('.contentText').scrollspy());

// for screen sizes greater than mobile breakpoint (991px), detect long lake names and navs with
// more than ~4 pills that wrap to two lines; css calc story height for proper scroll
var lakeHeader = document.getElementById('lakeHeader');
Expand Down
6 changes: 1 addition & 5 deletions lakegallery/map/templates/map/story_mobile.html
Original file line number Diff line number Diff line change
Expand Up @@ -338,17 +338,15 @@ <h2 class="mobilePageHeader" id="{{ story.section_three_nav|cut:' ' }}">{{ story
})

};
// var overlays = {};

var lakeLayer;

basemaps['Google Imagery'].addTo(map);

var account = 'tnris-flood';
// var static_url = "{% static 'map/images/' %}";

var resConfig = JSON.parse('{{ layer }}'.replace(/&#39;/g, '"').replace(/&quot;/g, "'"));
var linkConfig = JSON.parse('{{ links }}'.replace(/&#39;/g, '"'));
// var overlayQueryId = "{{ overlay_query }}";

// begin getLakeJson function - config & lakeName as args
function getLakeJson (config, lakeName) {
Expand Down Expand Up @@ -402,9 +400,7 @@ <h2 class="mobilePageHeader" id="{{ story.section_three_nav|cut:' ' }}">{{ story
});

var len = ticks.length;
// labelObject[len] = `<a href="https://tnris.org/texas-imagery-service/" target="_blank" title="Texas Imagery Service">Current</a>`;
labelObject[len] = `<a href="https://tnris.org/texas-imagery-service/" class="historical-link" target="_blank" title="Texas Imagery Service">Current</a>`;
// labelObject[len] = `<a href="https://tnris.org/texas-imagery-service/" target="_blank" title="Google Texas Imagery Service"><img src="{% static 'map/images/google-22px.png' %}"</img></a>`;
ticks.push(len);

// create labels for time slider with links to datahub historical imagery
Expand Down
6 changes: 2 additions & 4 deletions lakegallery/map/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@

app_name = 'map'
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^about/$', views.about, name='about'),
url(r'^([\w|\W]+)$', views.story, name='story'),
url(r'^([\w|\W]+)$', views.redirect_story),
#
url(r'^$', views.index, name='index')
url(r'^([\w|\W]+)$', views.story, name='story')
]
4 changes: 0 additions & 4 deletions lakegallery/map/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ def index(request):
return render(request, 'map/index.html', context)


def redirect_story(request, lake):
return redirect('/' + lake)


def story(request, lake):
res = get_lake_header_list()
m = MajorReservoirs.objects.get(res_lbl=lake)
Expand Down

0 comments on commit 7ca02fc

Please sign in to comment.