-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathservices.coffee
More file actions
33 lines (30 loc) · 985 Bytes
/
Copy pathservices.coffee
File metadata and controls
33 lines (30 loc) · 985 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
app = angular.module 'services', []
# Services used by controllers
app.service 'sharedProperties', ->
props = {
route: { start: -1, end: -1 },
markers: [],
panorama: {}
}
return {
Properties: -> return props,
setStart: (val) -> return props.route.start = val,
setEnd: (val) -> return props.route.end = val,
setMarkers: (val) -> return props.markers = val,
setPanorama: (val) -> return props.panorama = val.getGMap().getStreetView()
}
app.service 'markerService', ->
return {
setMarkerStatus: (marker, status) ->
if not marker?
return
else
marker.status = status
marker.showWindow = true if status is 'focused'
marker.prevIcon = "/vitaliikalinincrg/map-test//states/#{status}.png" if status isnt 'focused'
marker.icon = "/vitaliikalinincrg/map-test//states/#{status}.png"
,
setMarkerDefault: (marker) ->
marker.showWindow = false
marker.icon = marker.prevIcon
}