Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

Commit

Permalink
added different colors for pois and events markers
Browse files Browse the repository at this point in the history
  • Loading branch information
luigiselmi committed Mar 19, 2015
1 parent adce827 commit cde5625
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/main/webapp/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ <h1>FusepoolP3 Spatial Search Demo</h1>
id: 'examples.map-i875mjb7'
}).addTo(map);

var eventIcon = L.MakiMarkers.icon({icon: "marker", color: "#ff0", size: "1"});

var myIcon = L.MakiMarkers.icon({icon: "embassy", color: "#f00", size: "1"});
var myMarker = L.marker([46.071590, 11.123274], {
icon: myIcon,
Expand Down Expand Up @@ -73,18 +73,25 @@ <h1>FusepoolP3 Spatial Search Demo</h1>
*/
//map.on('click', onMapClick);

var eventIcon = L.MakiMarkers.icon({icon: "marker", color: "#ff0", size: "1"});
var poiIcon = L.MakiMarkers.icon({icon: "marker", color: "#339933", size: "1"});

var myLayerGroup = L.layerGroup().addTo(map);

function getJson(){
var container = document.getElementById('container').value;
var coords = document.getElementById('coordinates').value;
var date = document.getElementById('date').value;
var markerIcon = poiIcon;
if(date !=''){
markerIcon = eventIcon;
}
var radius = document.getElementById('radius').value;
$.getJSON("./search?coordinates="+coords+"&date="+date+"&radius="+radius+"&container="+container,function(data){
geojsonLayer = L.geoJson(data,{
//change icon to features
pointToLayer: function (feature,latlng) {
return L.marker(latlng,{icon: eventIcon});
return L.marker(latlng,{icon: markerIcon});
},
// add popup to feature
onEachFeature: function (feature, layer) {
Expand Down

0 comments on commit cde5625

Please sign in to comment.