Browse Source

Use leaflet config on leaflet map instances

pull/3/head
Nafies Luthfi 7 years ago
parent
commit
aaf6d39e59
  1. 4
      resources/views/outlets/create.blade.php
  2. 2
      resources/views/outlets/edit.blade.php
  3. 2
      resources/views/outlets/map.blade.php
  4. 3
      resources/views/outlets/show.blade.php

4
resources/views/outlets/create.blade.php

@ -63,8 +63,8 @@
integrity="sha512-/Nsx9X4HebavoBvEBuyp3I7od5tA0UzAxs+j83KgC8PU0kgB4XiK4Lfe4y4cgBtaRJQEIFCW+oC506aPT2L1zw==" integrity="sha512-/Nsx9X4HebavoBvEBuyp3I7od5tA0UzAxs+j83KgC8PU0kgB4XiK4Lfe4y4cgBtaRJQEIFCW+oC506aPT2L1zw=="
crossorigin=""></script> crossorigin=""></script>
<script> <script>
var mapCenter = ['-3.313695', '114.590148'];
var map = L.map('mapid').setView(mapCenter, 13);
var mapCenter = [{{ config('leaflet.map_center_latitude') }}, {{ config('leaflet.map_center_longitude') }}];
var map = L.map('mapid').setView(mapCenter, {{ config('leaflet.zoom_level') }});
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors' attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'

2
resources/views/outlets/edit.blade.php

@ -96,7 +96,7 @@
crossorigin=""></script> crossorigin=""></script>
<script> <script>
var mapCenter = [{{ $outlet->latitude }}, {{ $outlet->longitude }}]; var mapCenter = [{{ $outlet->latitude }}, {{ $outlet->longitude }}];
var map = L.map('mapid').setView(mapCenter, 16);
var map = L.map('mapid').setView(mapCenter, {{ config('leaflet.detail_zoom_level') }});
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors' attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'

2
resources/views/outlets/map.blade.php

@ -22,7 +22,7 @@
crossorigin=""></script> crossorigin=""></script>
<script> <script>
var map = L.map('mapid').setView(['-3.313695', '114.590148'], 13);
var map = L.map('mapid').setView([{{ config('leaflet.map_center_latitude') }}, {{ config('leaflet.map_center_longitude') }}], {{ config('leaflet.zoom_level') }});
var baseUrl = "{{ url('/') }}"; var baseUrl = "{{ url('/') }}";
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {

3
resources/views/outlets/show.blade.php

@ -45,7 +45,6 @@
<style> <style>
#mapid { height: 400px; } #mapid { height: 400px; }
.popup-content-row { margin: 6px 0; }
</style> </style>
@endsection @endsection
@push('scripts') @push('scripts')
@ -55,7 +54,7 @@
crossorigin=""></script> crossorigin=""></script>
<script> <script>
var map = L.map('mapid').setView([{{ $outlet->latitude }}, {{ $outlet->longitude }}], 16);
var map = L.map('mapid').setView([{{ $outlet->latitude }}, {{ $outlet->longitude }}], {{ config('leaflet.detail_zoom_level') }});
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors' attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'

Loading…
Cancel
Save