Open hijiangtao opened 7 years ago
hi @hijiangtao did you use the leaflet plugin from npm? ( npm install leaflet-heatmap ) because that was actually the rationale behind putting the plugins on npm, so it would only require a single import and the plugin takes care of its dependencies (in this case heatmap.js & leaflet)
Yes, actually I use import L from 'leaflet'
from package manager, and the version is "leaflet": "0.7.7"
, but it may not have too much impact on heatmap.js, since I saw lines of codes in heatmap.js that is dealing with the compatibility of different leaflet.js' version.
And on the other hand, it's simply a single import that really matters, but I thought if you could put more information in manual(documents) about how to create a new HeatmapOverlay via given cofiguration json format, I think it may be a little difficult for Node.js freshman to do these (they may be confused about the import directory and instance's creation process).
Thanks!
@hijiangtao thank you for the feedback, I will add some documentation about that on the heatmap.js website :)
Never mind :smile:
I found the installation guidance of heatmap.js in different context, it's very useful because I am currently using Node.js as my developing back-end context, but the usage in how to include them into these kinds of context is rare. Because CommonJS/Node.js need to load variable from package, and heatmap.js' plugin has specific instance creation approach, I think it's good to include these content into current documents/README.md, such as when I use ES6 as my writting grammar, I should do as follows to make my heatmap display normally with leaflet.js in the front-end browser:
Since the expression above will
require('heatmap.js')
internally, I don't need toimport heatmap from 'heatmap.js'
again any more.I think other plugins should have their own instance creation approach, it would be clear if they can be pointed out. Thanks.