-
Notifications
You must be signed in to change notification settings - Fork 7
Use the parameters from the layer if possible. #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -172,6 +172,8 @@ | |
| var queryPending = false; | ||
| var containerPos = findElPos(me.getMap().getDiv()); | ||
| var tol = opts.tolerance || 6; | ||
|
|
||
|
|
||
| google.maps.event.addListenerOnce(maptip, 'ready', function() { | ||
| // map.mousemove may not fire consistently, so we calc latlng from DOM events | ||
| me.mousemoveListener_ = google.maps.event.addDomListener(me.getMap().getDiv(), 'mousemove', function(evt) { | ||
|
|
@@ -192,7 +194,7 @@ | |
| var mousePos = findMousePos(evt); | ||
| var containerPx = new google.maps.Point(mousePos.x - containerPos.x, mousePos.y - containerPos.y); | ||
| currentLatLng = maptip.getProjection().fromContainerPixelToLatLng(containerPx); | ||
| delayTimeout = window.setTimeout(queryFusion, opts.delay || 400); | ||
| delayTimeout = window.setTimeout(queryFusion, opts.delay || 200); | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. did you mean to commit this? 400 may indeed be too slow, but just wanted to check
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi, not it is not necessary, this is just from my main branch where it leads to a better user experience in my case. |
||
| } | ||
| currentCursor = c; | ||
| }); | ||
|
|
@@ -215,11 +217,16 @@ | |
| px.y -= tol * 2; | ||
| var ne = prj.fromDivPixelToLatLng(px); | ||
| var bounds = new google.maps.LatLngBounds(sw, ne); | ||
| var swhere = "ST_INTERSECTS(" + opts.geometryColumn + ",RECTANGLE(LATLNG(" + bounds.getSouthWest().lat() + "," + bounds.getSouthWest().lng() + "),LATLNG(" + bounds.getNorthEast().lat() + "," + bounds.getNorthEast().lng() + ")))"; | ||
| if (opts.where) { | ||
| swhere += " AND " + opts.where; | ||
| // Use the geometry column from the fusion table layer. | ||
| var geometryColumn = opts.geometryColumn || me.query.select; | ||
| var swhere = "ST_INTERSECTS(" + geometryColumn + ",RECTANGLE(LATLNG(" + bounds.getSouthWest().lat() + "," + bounds.getSouthWest().lng() + "),LATLNG(" + bounds.getNorthEast().lat() + "," + bounds.getNorthEast().lng() + ")))"; | ||
| var where = opts.where || me.query.where; | ||
| if (where) { | ||
| swhere += " AND " + where; | ||
| } | ||
| var queryText = encodeURIComponent("SELECT " + opts.select + " FROM " + opts.from + " WHERE " + swhere); | ||
| // Use the table id from the fusion table layer. | ||
| var tableid = opts.from || me.query.from; | ||
| var queryText = encodeURIComponent("SELECT " + opts.select + " FROM " + tableid + " WHERE " + swhere); | ||
| queryPending = true; | ||
| queryFusionJson(latlng, queryText); | ||
| } | ||
|
|
@@ -304,14 +311,27 @@ | |
| } | ||
|
|
||
| }; | ||
| /** | ||
| * Checks where there is map tips enabled. | ||
| */ | ||
| google.maps.FusionTablesLayer.prototype.hasMapTips = function() { | ||
| if (this.maptipOverlay_) { | ||
| return true; | ||
| } else { | ||
| return false; | ||
| } | ||
| }; | ||
|
|
||
| /** | ||
| * Disable map tips for the fusion layer. | ||
| */ | ||
| google.maps.FusionTablesLayer.prototype.disableMapTips = function() { | ||
| this.maptipOverlay_.setMap(null); | ||
| this.maptipOverlay_ = null; | ||
| google.maps.event.removeListener(this.mousemoveListener_); | ||
| this.mousemoveListener_ = null; | ||
| if (this.maptipOverlay_) { | ||
| this.maptipOverlay_.setMap(null); | ||
| this.maptipOverlay_ = null; | ||
| google.maps.event.removeListener(this.mousemoveListener_); | ||
| this.mousemoveListener_ = null; | ||
| } | ||
| }; | ||
| // cleanup | ||
| var _setMap_ = google.maps.FusionTablesLayer.prototype.setMap; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's remove these extra line breaks