railmapgen / rmp

Design your own rail map by freely dragging stations from different cities and connecting them with 135-degree rounded corners or perpendicular lines!
https://railmapgen.github.io/?app=rmp
GNU General Public License v3.0
82 stars 15 forks source link

【愿景】自动/批量写入车站、通过接口使用本地代码绘制 #680

Closed xiao-slm closed 3 months ago

xiao-slm commented 3 months ago

将样式文件存储在本地,使用时直接调用(类似c++ struct) 直接输出json(用于第三方绘制等

thekingofcity commented 3 months ago

嗨,简单两句无法理解您所提到的功能,方便的话请按照问题、解决步骤、期待结果和涉及的(伪)代码来说明 :)

xiao-slm commented 3 months ago
struct shmetro_basic{
 string nodes_key'
 //...
}test={"stn_114514"};

int main(){
 cout<<"..."<<test.key<<"...";
}

类似改该例子

xiao-slm commented 3 months ago

这个例子中使用的是上海地铁基本车站

xiao-slm commented 3 months ago

嗨,简单两句无法理解您所提到的功能,方便的话请按照问题、解决步骤、期待结果和涉及的(伪)代码来说明 :)

struct shmetro_basic{
 string nodes_key'
 //...其他属性和不改变的值,建议使用(全部)string以方便合成
}test={"stn_114514"};

int main(){
 cout<<"..."<<test.key<<"...";//当然也可以(在之后)使用已经合成完成的json(如test.jsonall)
}
thekingofcity commented 3 months ago

嗨,json文件定义可以参考这两个文件,欢迎自行转为c++类型并使用 :)

https://github.com/railmapgen/rmp/blob/3cf688b8e46a831faa8f6122c48f11b6081d638e/src/redux/param/param-slice.ts https://github.com/railmapgen/rmp/blob/f71a276f6ec3a4d9f8fb3892f373b6468a17e319/src/constants/constants.ts

xiao-slm commented 3 months ago

嗨,json文件定义可以参考这两个文件,欢迎自行转为c++类型并使用 :)

https://github.com/railmapgen/rmp/blob/3cf688b8e46a831faa8f6122c48f11b6081d638e/src/redux/param/param-slice.ts https://github.com/railmapgen/rmp/blob/f71a276f6ec3a4d9f8fb3892f373b6468a17e319/src/constants/constants.ts

谢谢您提供的参考资料,但是我只会c++/c