forked from 0x2620/oxjs
more docs
This commit is contained in:
parent
bdb8d98787
commit
cc75e25415
42 changed files with 664 additions and 93 deletions
|
|
@ -1,5 +1,15 @@
|
|||
// vim: et:ts=4:sw=4:sts=4:ft=js
|
||||
|
||||
/*@
|
||||
Ox.MapMarker <f> MapMarker Object
|
||||
(options) -> <f> MapMarker Object
|
||||
options <o> Options object
|
||||
color <a|[255, 0, 0]> marker color
|
||||
map <o|null> map
|
||||
place <o|null> place
|
||||
size <n|16> size
|
||||
@*/
|
||||
|
||||
Ox.MapMarker = function(options) {
|
||||
|
||||
options = Ox.extend({
|
||||
|
|
@ -150,33 +160,56 @@ Ox.MapMarker = function(options) {
|
|||
}
|
||||
}
|
||||
|
||||
/*@
|
||||
add <f> add to map
|
||||
() -> <f> add to map, returns MapMarker
|
||||
@*/
|
||||
that.add = function() {
|
||||
that.marker.setMap(that.map.map);
|
||||
google.maps.event.addListener(that.marker, 'click', click);
|
||||
return that;
|
||||
};
|
||||
|
||||
/*@
|
||||
edit <f> edit marker
|
||||
() -> <f> edit marker, returns MapMarker
|
||||
@*/
|
||||
that.edit = function() {
|
||||
setOptions();
|
||||
google.maps.event.addListener(that.marker, 'dragstart', dragstart);
|
||||
google.maps.event.addListener(that.marker, 'drag', drag);
|
||||
google.maps.event.addListener(that.marker, 'dragend', dragend);
|
||||
return that;
|
||||
};
|
||||
|
||||
|
||||
/*@
|
||||
remove <f> remove marker
|
||||
() -> <f> remove marker from map, returns MapMarker
|
||||
@*/
|
||||
that.remove = function() {
|
||||
that.marker.setMap(null);
|
||||
google.maps.event.clearListeners(that.marker);
|
||||
return that;
|
||||
};
|
||||
|
||||
/*@
|
||||
submit <f> submit marker
|
||||
() -> <f> clear edit listeners, returns MapMarker
|
||||
@*/
|
||||
that.submit = function() {
|
||||
google.maps.event.clearListeners(that.marker, 'dragstart');
|
||||
google.maps.event.clearListeners(that.marker, 'drag');
|
||||
google.maps.event.clearListeners(that.marker, 'dragend');
|
||||
return that;
|
||||
}
|
||||
|
||||
/*@
|
||||
update <f> update marker
|
||||
() -> <f> update marker, returns MapMarker
|
||||
@*/
|
||||
that.update = function() {
|
||||
setOptions();
|
||||
return that;
|
||||
}
|
||||
|
||||
return that;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue