From ad5adb94f1c590c718da56b69604837adbefc265 Mon Sep 17 00:00:00 2001 From: Kuldeep Lodha <kuldeeplodha04@gmail.com> Date: Mon, 10 Jul 2023 12:31:23 +0530 Subject: [PATCH] Adding Changes for Pune District City Adding Center location and zoom level for Pune District city. --- graphs/views.py | 2 ++ static/js/city_wise_map.js | 9 +++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/graphs/views.py b/graphs/views.py index 35f4587b..3107446b 100755 --- a/graphs/views.py +++ b/graphs/views.py @@ -441,6 +441,8 @@ def get_data(key): output_data['city'][city_name]['total_slum_count'] = total_slum_count if city_name == 'Saharanpur': output_data['city'][city_name]['household_count__sum'] = 3930 + if city_name == 'Pune District': + output_data['city'][city_name]['household_count__sum'] = 2500 return output_data result = get_data(key) diff --git a/static/js/city_wise_map.js b/static/js/city_wise_map.js index 233fbcfa..7f893e83 100644 --- a/static/js/city_wise_map.js +++ b/static/js/city_wise_map.js @@ -130,19 +130,24 @@ function initMap(){ "PCMC":new L.LatLng(18.640083, 73.825560), "Pune":new L.LatLng(18.51099762698481, 73.86055464212859), "Panvel":new L.LatLng(19.051509, 73.109058), - "Saharanpur":new L.LatLng(29.96813172,77.54673382)}; + "Saharanpur":new L.LatLng(29.96813172,77.54673382), + "Pune District":new L.LatLng(18.57054718,74.07657987)}; var pos = new L.LatLng(18.640083, 73.825560); if ($('#city_name').val() in center_data) { pos = center_data[$('#city_name').val()]; } + map = new L.Map('map', { center: pos, zoom: 12, zoomSnap: 0.25, markerZoomAnimation:false }); - + // Changing Zoom level for Pune District. + if ($('#city_name').val() == 'Pune District'){ + map.setZoom(9); + }; var ggl = L.gridLayer.googleMutant({type: 'satellite' }).addTo(map); initMap12(); }