brendankenny / canvaslayer Goto Github PK
View Code? Open in Web Editor NEWA <canvas> map layer for the Google Maps JavaScript API v3 for 2d and WebGL data visualization
License: Apache License 2.0
A <canvas> map layer for the Google Maps JavaScript API v3 for 2d and WebGL data visualization
License: Apache License 2.0
If you drag this map to the right, at some point the canvas shifts to the following left map.
Is there a way to prevent this behavior?
Can this be an npm package? Would be nice to get it in my package.json with semantic versioning.
Hello! I'm trying to use this library but cannot even initialize it. It's dropping me InvalidValueError: setMap: not an instance of Map; and not an instance of StreetViewPanorama
error.
var canvasLayerOptions = {
map: this.map,
animate: false
};
var canvasLayer = new CanvasLayer(canvasLayerOptions);
return canvasLayer.canvas.getContext('2d');
That's the code, that I'm using to initialize it. this.map
is not undefined and instanceof google.maps.Map
on it returns true
This is because moving the canvas is being done with the transform
CSS property which IE8 doesn't support.
I have a simple PR which uses margin-left
and margin-top
instead, when the browser doesn't support transform
.
I know IE8 is legacy but I had to do that change for my application. If you think it's useful to have it merged I can submit it. If not, I completely understand why and just feel free to close this issue.
The Google Maps API has a new renderer that causes wrong position updates with the WebGL layer during the zoom.
See: https://developers.google.com/maps/documentation/javascript/new-renderer#troubleshooting
Would be great to have the overlay in sync!
Hi @brendankenny,
in your presentation you showed an info window: https://youtu.be/aZJnI6hxr-c?t=2009
could you post your canvas event listener code and how you store all lat/long points for lookup?
Thanks
I was trying to figure out why dragging the map took the canvas some time to follow it, producing a noticeable not-in-sync lag.
It puzzled me because I was not seeing that happening on your talks on youtube. I thought it was some sort of lack of hardware acceleration on my laptop.
I disabled the center_changed listener on the map, which was triggering this.repositionFunction_ and noticed it stopped happening on the sample hello2d, but caused some delays on displaying markers on hello_webgl. Browsed along and found your todo:
https://github.com/brendankenny/CanvasLayer/blob/gh-pages/src/CanvasLayer.js#L474-476
That's it right?
In my app, it is desirable to get a 'reposition' callback. This then allows me to recompute the various matrixes and drawing buffers. Currently I have to do this calculation in the update callback. I guess that I could just look and see if the bounds have changed, and recompute then....
hello_webgl canvas translates independent from map on a vertical window resize,
as canvasLayerOptions: resizeHandler does not seem to getting called on a window resize event.
workaround: NeuralSpaz@213045e for hello_webgl
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.