diff --git a/demos/index.html b/demos/index.html new file mode 100644 index 0000000000..489e8a779d --- /dev/null +++ b/demos/index.html @@ -0,0 +1,1905 @@ + + + + + + + + + + + Demos + + + +
+
+ +
+
+ +
+ +
+ +
+ +
+ + + +
+ +
+ +
+
+ + + + +
+
+ +
+ +
+ + + + + +
+
+ + + +
+
04_image
+
+
+
+ +
+ +
+ +
+
+ + + +
+
06_text
+
+
+
+ +
+
+ + + +
+
07_city
+
+
+
+ +
+
+ + + + +
+
+ +
+ +
+ +
+
+ + + +
+
grid
+
+
+
+ +
+
+ + + +
+
heatmap
+
+
+
+ +
+
+ + + +
+
hexgon
+
+
+
+ +
+
+ + + +
+
line
+
+
+
+ +
+
+ + + +
+
mapbox
+
+
+
+ +
+
+ + + +
+
meshline
+
+
+
+ +
+
+ + + +
+
taxi
+
+
+
+ +
+ +
+ + + + + + + + + + + diff --git a/src/geom/shader/heatmap_colorize_frag.glsl b/src/geom/shader/heatmap_colorize_frag.glsl index e2c790b914..cf531398db 100644 --- a/src/geom/shader/heatmap_colorize_frag.glsl +++ b/src/geom/shader/heatmap_colorize_frag.glsl @@ -6,4 +6,6 @@ void main(){ float intensity = texture2D(u_texture,v_uv).r; vec4 color = texture2D(u_colorRamp,vec2(0.5,1.0-intensity)); gl_FragColor = color; + gl_FragColor.a = color.a * smoothstep(0.,0.05,intensity); + } \ No newline at end of file diff --git a/src/map/AMap.js b/src/map/AMap.js index cf45151dcc..0d4daff491 100644 --- a/src/map/AMap.js +++ b/src/map/AMap.js @@ -126,38 +126,36 @@ export default class GaodeMap extends Base { scene.getZoom = () => { return map.getZoom(); }; - scene.setZoom = () => { - return map.setZoom(); + scene.setZoom = zoom => { + return map.setZoom(zoom); }; - scene.setBounds = () => { - return map.setBounds(); + scene.setBounds = extent => { + return map.setBounds(new AMap.Bounds([ extent[0], extent[1] ], [ extent[2], extent[3] ])); }; - scene.setRotation = () => { - return map.setRotation(); + scene.setRotation = rotation => { + return map.setRotation(rotation); }; scene.zoomIn = () => { return map.zoomIn(); }; - scene.setRotation = () => { - return map.setRotation(); - }; scene.zoomOut = () => { return map.zoomOut(); }; - scene.panTo = () => { - return map.panTo(); + scene.panTo = lnglat => { + return map.panTo(new AMap.LngLat(lnglat[0], lnglat[1])); }; - scene.panBy = () => { - return map.panBy(); + scene.panBy = (x, y) => { + return map.panBy(x, y); }; - scene.setPitch = () => { - return map.setPitch(); + scene.setPitch = pitch => { + return map.setPitch(pitch); }; - scene.pixelToLngLat = () => { - return map.pixelToLngLat(); + scene.pixelToLngLat = pixel => { + const ll = new AMap.Pixel(pixel[0], pixel[1]); + return map.pixelToLngLat(ll); }; - scene.lngLatToPixel = () => { - return map.lngLatToPixel(); + scene.lngLatToPixel = lnglat => { + return map.lngLatToPixel(new AMap.LngLat(lnglat[0], lnglat[1])); }; scene.setMapStyle = style => { return map.setMapStyle(style);