Skip to content

Commit

Permalink
tarcks alerts
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanocudini committed Apr 10, 2019
1 parent 3116fc0 commit c5d9aba
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- plugin admin new method for debug data in database, sanitizePlacesField
- plugin geoinfo sanitize text values
- plugin stats new stat findPlacesByField
- plugins pois tracks, alert not found
- fix K.Util.sanitize.regExp
- fix mobile status
- fix K.Map zoomout geojson reloading
Expand Down
3 changes: 3 additions & 0 deletions packages/pois/client/Place_pois.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ Kepler.Place.include({

self.poisList = K.findPoisByLoc(self.loc).fetch();

if(!self.poisList.length)
sAlert.warning(i18n('error_nopoisfound'))

self._dep.changed();

cb.call(self, K.Pois.poisToGeojson(self.poisList) );
Expand Down
4 changes: 3 additions & 1 deletion packages/pois/i18n/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,7 @@ i18n.map('en', {
pois_type_eat: "Where to eat",
pois_type_camp: "Where to camp",
pois_type_bed: "Where to sleep",
pois_type_bus: "Bus stop"
pois_type_bus: "Bus stop",

error_nopoisfound: "Points Of Interest Not Found nearby",
});
1 change: 1 addition & 0 deletions packages/pois/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ K.Plugin({
"maxDistance": 500,
"importPois": true, //enable importing of pois like place
"typesByTags": {
//osm tags classification
"amenity=drinking_water": "water",
"amenity=fountain": "water",
"amenity=bar": "drink",
Expand Down
7 changes: 5 additions & 2 deletions packages/tracks/client/Place_tracks.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@ Kepler.Place.include({
else
Meteor.subscribe('tracksByPlace', self.id, function() {

self.tracksList = findTracksByLoc(self.loc).fetch();
self.tracksList = K.findTracksByLoc(self.loc).fetch();

if(!self.tracksList.length)
sAlert.warning(i18n('error_notracksfound'))

self._dep.changed();

cb(self.tracksList);
Expand All @@ -28,7 +31,7 @@ Kepler.Place.include({
self.loadTracks(function(tracksList) {

if(trackId)
tracksList = findTracksByIds([trackId]).fetch();
tracksList = K.findTracksByIds([trackId]).fetch();

K.Map.addGeojson( self.tracksToGeojson(tracksList, self), {
style: K.settings.public.map.styles.tracks
Expand Down
4 changes: 2 additions & 2 deletions packages/tracks/collections/tracks.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@

Tracks = new Mongo.Collection('tracks');

findTracksByIds = function(tracksIds) {
K.findTracksByIds = function(tracksIds) {
return Tracks.find({_id: {$in: tracksIds}});
};

findTracksByLoc = function(ll) {
K.findTracksByLoc = function(ll) {

return Tracks.find({
//'properties.end': {
Expand Down
2 changes: 2 additions & 0 deletions packages/tracks/i18n/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ i18n.map('en', {

tracks_type_access: "Approaching",
tracks_type_other: "Other",

error_notracksfound: "Tracks Not Found nearby",
});
4 changes: 3 additions & 1 deletion packages/tracks/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ K.Plugin({
"caching": true, //cache response by OSM overpass
"maxDistance": 800,
"typesByTags": {
//osm tags classification
"highway=path": "path",
"highway=track": "path",
"highway=footway": "path"
"highway=footway": "path",
"highway=pedestrian": "path"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/tracks/server/pubs.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Meteor.publish('tracksByPlace', function(placeId) {
loc = placeData.loc,
imported = 0;

//var tracksCur = findTracksByLoc(loc);
//var tracksCur = K.findTracksByLoc(loc);
//TODO optimize this condition caching
//if(tracksCur.count()===0) {
var findOsm = function(loc) {
Expand Down Expand Up @@ -63,7 +63,7 @@ Meteor.publish('tracksByPlace', function(placeId) {

console.log('Pub: tracksByPlace import from osm ',imported,'ways');

tracksCur = findTracksByLoc(placeData.loc);
tracksCur = K.findTracksByLoc(placeData.loc);
//}

console.log('Pub: tracksByPlace', placeId, tracksCur.count(),'tracks');
Expand Down

0 comments on commit c5d9aba

Please sign in to comment.