Skip to content

Instantly share code, notes, and snippets.

@gurkan0791 gurkan0791/app.js
Created Sep 27, 2016

What would you like to do?
Using Java JSTL inside Javascript
//JSTL combined Javascript
var markers = [
<c:forEach var="row" items="${result.rows}">
['<c:out value="${row.aciklama}" />',
<c:out value="${row.KONUME}" />, //double without apostrophe
<c:out value="${row.KONUMB}" />,
<c:out value="${row.EVID}" />,
'<c:out value="${row.aptadi}" />',
'<c:out value="${row.mahalle}" />',
'<c:out value="${row.sokak}" />',
'<c:out value="${row.durumu}" />',
'<c:out value="${row.metrekare}" />',
'<c:out value="${row.fiyat}" />',
'<c:out value="${row.odasayisi}" />'],
</c:forEach> ];
// using array create makers google maps api
for( i = 0; i < markers.length; i++ ) {
var position = new google.maps.LatLng(markers[i][1],markers[i][2]);
marker = new google.maps.Marker({
position: position,
map: map,
title: markers[i][0],
google.maps.event.addListener(marker, 'click', (function(marker, i) { ...}
} //for end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.