Added map to kivi ad preview.
This commit is contained in:
@@ -198,9 +198,7 @@
|
||||
} */
|
||||
|
||||
if (!hasErrors) {
|
||||
//
|
||||
alert("Pokusavam submit formu!");
|
||||
|
||||
|
||||
$("#publishForm").submit();
|
||||
};
|
||||
|
||||
|
||||
@@ -1,20 +1,11 @@
|
||||
<br>
|
||||
<div class="row">
|
||||
<% for (const field of booleanFields){ %>
|
||||
<p>
|
||||
<span><%= field.title %></span>
|
||||
|
||||
</p>
|
||||
<% } %>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
<div class="row">
|
||||
<div class="row col s12">
|
||||
<% for (const field of inputFields){ %>
|
||||
<p>
|
||||
<span><%= field.title %></span>
|
||||
<span><%= allInputValues[field.dbField] %></span>
|
||||
<span class="col s4"><%= field.title %></span>
|
||||
<span class="col s8 distinguished dont-break-out"><%= allInputValues[field.dbField] %></span>
|
||||
</p>
|
||||
<br>
|
||||
<% } %>
|
||||
</div>
|
||||
|
||||
@@ -22,12 +13,81 @@
|
||||
<div class="row">
|
||||
<% for (const field of segmentFields){ %>
|
||||
<p>
|
||||
<span><%= field.title %></span>
|
||||
<span class="col s4"><%= field.title.replace(/>/g,'') %></span>
|
||||
<% for (const segmentObject of field.values) { %>
|
||||
<% if (allSegmentSelectedValues[field.dbField] === segmentObject.id) { %>
|
||||
<span><%= segmentObject.title %></span>
|
||||
<% } %>>
|
||||
<span class="col s8 distinguished"><%= segmentObject.title.replace(/>/g,'') %></span>
|
||||
<% } %>
|
||||
<% } %>
|
||||
</p>
|
||||
<br>
|
||||
<% } %>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="row col s12">
|
||||
<% for (const field of booleanFields){ %>
|
||||
<p class="col s4">
|
||||
<span>✓</span>
|
||||
<span><%= field.title %></span>
|
||||
|
||||
</p>
|
||||
<% } %>
|
||||
</div>
|
||||
|
||||
<div class="row center-align ">
|
||||
<div class="distinguished">
|
||||
<span>Lokacija nekretnine</span>
|
||||
|
||||
</div>
|
||||
<br>
|
||||
<br>
|
||||
<div class="col s12">
|
||||
<div id="map"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
let map;
|
||||
|
||||
function initMap() {
|
||||
const BOSNIA_BOUNDS = {
|
||||
north: 45.7,
|
||||
south: 41.69,
|
||||
west: 15.55,
|
||||
east: 20.77
|
||||
};
|
||||
const ESTATE_COORDINATES = {
|
||||
lat: <%= locationLat %>,
|
||||
lng: <%= locationLong %>
|
||||
};
|
||||
|
||||
const mapElement = document.getElementById("map");
|
||||
const restrictMapPanningToBosniaOnly = {
|
||||
latLngBounds: BOSNIA_BOUNDS,
|
||||
strictBounds: true
|
||||
};
|
||||
const initialMapParams = {
|
||||
center: ESTATE_COORDINATES,
|
||||
zoom: 13,
|
||||
restriction: restrictMapPanningToBosniaOnly,
|
||||
mapTypeControl: false,
|
||||
panControl: false,
|
||||
zoomControl: true,
|
||||
streetViewControl: false
|
||||
};
|
||||
map = new google.maps.Map(mapElement, initialMapParams);
|
||||
|
||||
marker = new google.maps.Marker({
|
||||
position: ESTATE_COORDINATES,
|
||||
map: map,
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
<script
|
||||
src="https://maps.googleapis.com/maps/api/js?key=<%= process.env.API_MAP_KEY %>&language=bs&libraries=places&callback=initMap"
|
||||
async
|
||||
defer
|
||||
></script>
|
||||
Reference in New Issue
Block a user