<buttontype="button"id="exportGeoJson"download="geoJson.json"onclick="exportToGeoJSON($('#downloadLinkFwrd'),JSON.stringify(map._layers[$(this).attr('leaflet_id')].toGeoJSON(),null, '\t'))"class="btn btn-info btn-xs"data-toggle="tooltip"data-placement="left"title="Export selected area as a geoJson file">Export</button>
<buttontype="button"id="hideViewFence"class="btn btn-info btn-xs"data-toggle="tooltip"data-placement="left"title="Hide this fence"onclick="map.removeLayer(map._layers[$(this).attr('leaflet_id')])">Hide</button>
<buttontype="button"id="exportGeoJson"download="geoJson.json"onclick="exportToGeoJSON($('#downloadLinkFwrd'),JSON.stringify(map._layers[$(this).attr('leaflet_id')].toGeoJSON(),null, '\t'))"class="btn btn-info btn-xs"data-toggle="tooltip"data-placement="left"title="Export selected area as a geoJson file">Export</button>
<labelclass="text-info">Area name</label>
<buttontype="button"id="hideViewFence"class="btn btn-info btn-xs"data-toggle="tooltip"data-placement="left"title="Hide this fence"onclick="map.removeLayer(map._layers[$(this).attr('leaflet_id')])">Hide</button>
<aid="exportGeoJson"download="geoJson.json"href="#"onclick="exportToGeoJSON(this,JSON.stringify(map._layers[$(this).attr('leaflet_id')].toGeoJSON(),null, '\t'))"class="btn btn-default btn-xs"data-toggle="tooltip"data-placement="left"title="Export selected area as a geoJson file">Export</a>
</div>
<divclass="btn-group">
<aid="hideViewFence"class="btn btn-default btn-xs"data-toggle="tooltip"data-placement="left"title="Hide this fence"onclick="map.removeLayer(map._layers[$(this).attr('leaflet_id')])">Hide</a>
<buttontype="button"id="exportGeoJson"download="geoJson.json"onclick="exportToGeoJSON($('#downloadLinkFwrd'),JSON.stringify(map._layers[$(this).attr('leaflet_id')].toGeoJSON(),null, '\t'))"class="btn btn-info btn-xs"data-toggle="tooltip"data-placement="left"title="Export selected area as a geoJson file">Export</button>
<divid="viewAreaName"class="well well-sm"></div>
<buttontype="button"id="hideViewFence"class="btn btn-info btn-xs"data-toggle="tooltip"data-placement="left"title="Hide this fence"onclick="map.removeLayer(map._layers[$(this).attr('leaflet_id')])">Hide</button>
<aid="exportGeoJson"download="geoJson.json"href="#"onclick="exportToGeoJSON(this,JSON.stringify(map._layers[$(this).attr('leaflet_id')].toGeoJSON(),null, '\t'))"class="btn btn-default btn-xs"data-toggle="tooltip"data-placement="left"title="Export selected area as a geoJson file">Export</a>
</div>
<divclass="btn-group">
<aid="hideViewFence"class="btn btn-default btn-xs"data-toggle="tooltip"data-placement="left"title="Hide this fence"onclick="map.removeLayer(map._layers[$(this).attr('leaflet_id')])">Hide</a>
define stream dataOut (id string, latitude double, longitude double, timeStamp long, type string ,speed float, heading float, eventId string, state string, information string);
from dataIn[geo:within(longitude,latitude,"$geoFenceGeoJSON")==false and id == "$deviceId"]#geodashboard:subscribe()
select id , latitude, longitude,timeStamp, type, speed, heading ,eventId , "ALERTED" as state, "This device is in $areaName restricted area!!!" as information
insert into dataOut;
from dataIn[geo:within(longitude,latitude,"$geoFenceGeoJSON")!=false and id == "$deviceId"]
select id , latitude, longitude,timeStamp, type, speed, heading ,eventId , "NORMAL" as state, "" as information
@ -587,11 +631,11 @@ function createExecutionPlanName(queryName, id, deviceId) {
if(id=="WithIn"){
if(id=="WithIn"){
return'Geo-ExecutionPlan-Within'+(queryName?'_'+queryName:'')+"---"+(deviceId?'_'+deviceId:'')+'_alert';// TODO: value of the `queryName` can't be empty, because it will cause name conflicts in CEP, have to do validation(check not empty String)
return'Geo-ExecutionPlan-Within'+(queryName?'_'+queryName:'')+"---"+(deviceId?'_'+deviceId:'')+'_alert';// TODO: value of the `queryName` can't be empty, because it will cause name conflicts in CEP, have to do validation(check not empty String)
}
}elseif(id=="Exit"){
elseif(id=="Stationery"){
return'Geo-ExecutionPlan-Exit'+(queryName?'_'+queryName:'')+"---"+(deviceId?'_'+deviceId:'')+'_alert';// TODO: value of the `queryName` can't be empty, because it will cause name conflicts in CEP, have to do validation(check not empty String)
}elseif(id=="Stationery"){
return'Geo-ExecutionPlan-Stationery'+(queryName?'_'+queryName:'')+"---"+(deviceId?'_'+deviceId:'')+'_alert';// TODO: value of the `queryName` can't be empty, because it will cause name conflicts in CEP, have to do validation(check not empty String)
return'Geo-ExecutionPlan-Stationery'+(queryName?'_'+queryName:'')+"---"+(deviceId?'_'+deviceId:'')+'_alert';// TODO: value of the `queryName` can't be empty, because it will cause name conflicts in CEP, have to do validation(check not empty String)
}
}elseif(id=="Traffic"){
elseif(id=="Traffic"){
return'Geo-ExecutionPlan-Traffic'+(queryName?'_'+queryName:'')+'_alert';// TODO: value of the `queryName` can't be empty, because it will cause name conflicts in CEP, have to do validation(check not empty String)
return'Geo-ExecutionPlan-Traffic'+(queryName?'_'+queryName:'')+'_alert';// TODO: value of the `queryName` can't be empty, because it will cause name conflicts in CEP, have to do validation(check not empty String)