Skip to content

Commit

Permalink
#25 add selection feedback polygon
Browse files Browse the repository at this point in the history
  • Loading branch information
gyuque committed Feb 4, 2014
1 parent 7467767 commit f58c993
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
3 changes: 3 additions & 0 deletions inner/css/map.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.on-selection>div>div>div {
cursor: crosshair !important;
}
21 changes: 19 additions & 2 deletions inner/js/ui/map-pane.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@ if (!window.mobmap) { window.mobmap={}; }
this.gmap = null;
this.ownerApp = null;
this.darkMapType = null;

this.pointingMode = PMODE_DEFAULT;


// Preview overlays
this.selectionPolygonpath = null;
this.selectionPreviewPolygon = null;

this.initialLocation = {
zoom: 8,
lat: 36.7,
Expand All @@ -25,6 +28,7 @@ if (!window.mobmap) { window.mobmap={}; }

this.setupGoogleMaps();
this.setupCaptureEvents();
this.setupSelectionPolygon();
}

MapPane.NEED_OVERLAYS_RENDER_EVENT = "mappane-needs-overalys-render";
Expand Down Expand Up @@ -188,6 +192,19 @@ if (!window.mobmap) { window.mobmap={}; }

selDidDisposeSession: function(selController) {
this.leaveSpecialPointingMode();
},

// Selection feedback views = = =

setupSelectionPolygon: function() {
this.selectionPolygonpath = [];
this.selectionPreviewPolygon = new google.maps.Polygon({
strokeColor: "#0000dd",
strokeOpacity: 0.8,
strokeWeight: 0.5,
fillColor: "#0000dd",
fillOpacity: 0.3
});
}
};

Expand Down

0 comments on commit f58c993

Please sign in to comment.