首页 > 解决方案 > 用传单在地图上显示点

问题描述

我的数据库中有大约 150k 点,我需要使用 axios req 从数据库中获取它们,然后在地图上显示它们。我的应用程序使用 PRN 框架。用nodejs构建这条路线并做出反应传单的最佳方法是什么?有任何选项可以执行分页方法吗?

标签: node.jsreactjsreact-leaflet

解决方案


You can use PostGIS to insert and select data from the database. I did something like this on a personal project. You can check it out here:

https://github.com/gwerle/sharedgis-backend

https://github.com/gwerle/sharedgis-frontend

To select from database using PostGIS you can do something like this:

SELECT column_1, column_2, ST_X(geom::geometry), ST_Y(geom::geometry) FROM table

You can add a marker in each point using the <Marker> tag (docs here https://react-leaflet.js.org/docs/example-popup-marker).


推荐阅读