GSMEthesis commited on
Commit
2af48fe
·
verified ·
1 Parent(s): 517d7ae

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +45 -13
app.py CHANGED
@@ -1000,46 +1000,78 @@ def create_ride_map():
1000
  destination = [35.7552343, 51.4204264] # پل طبیعت
1001
  purple = "#6a0dad"
1002
 
1003
- m = folium.Map(location=[(origin[0] + destination[0]) / 2, (origin[1] + destination[1]) / 2], zoom_start=13)
 
1004
 
1005
- # مبدأ - دایره بنفش
1006
  folium.Marker(
1007
  location=origin,
1008
  tooltip="مبدأ",
1009
  icon=folium.DivIcon(
1010
  html=f"""
1011
- <div style="
1012
- width: 16px;
1013
- height: 16px;
1014
- background-color: {purple};
1015
- border-radius: 50%;
1016
- border: 2px solid white;
1017
- box-shadow: 0 0 3px rgba(0,0,0,0.4);
1018
- "></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1019
  """
1020
  )
1021
  ).add_to(m)
1022
 
1023
- # مقصد - پرچم با رنگ بنفش
1024
  folium.Marker(
1025
  location=destination,
1026
  tooltip="مقصد",
1027
  icon=folium.DivIcon(
1028
  html=f"""
1029
- <div style="position: relative; width: 16px; height: 16px;">
1030
  <div style="
1031
  width: 0;
1032
  height: 0;
1033
  border-top: 8px solid transparent;
1034
  border-bottom: 8px solid transparent;
1035
  border-left: 12px solid {purple};
 
 
1036
  "></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
1037
  </div>
1038
  """
1039
  )
1040
  ).add_to(m)
1041
 
1042
- # خط مسیر بنفش
1043
  folium.PolyLine(
1044
  [origin, destination],
1045
  color=purple,
 
1000
  destination = [35.7552343, 51.4204264] # پل طبیعت
1001
  purple = "#6a0dad"
1002
 
1003
+ m = folium.Map(location=[(origin[0] + destination[0]) / 2,
1004
+ (origin[1] + destination[1]) / 2], zoom_start=13)
1005
 
1006
+ # 💠 مبدأ - دایره + لیبل
1007
  folium.Marker(
1008
  location=origin,
1009
  tooltip="مبدأ",
1010
  icon=folium.DivIcon(
1011
  html=f"""
1012
+ <div style="display: flex; align-items: center; direction: rtl;">
1013
+ <div style="
1014
+ width: 14px;
1015
+ height: 14px;
1016
+ background-color: {purple};
1017
+ border: 3px solid white;
1018
+ border-radius: 50%;
1019
+ box-shadow: 0 0 3px rgba(0,0,0,0.5);
1020
+ margin-left: 6px;
1021
+ "></div>
1022
+ <div style="
1023
+ background-color: white;
1024
+ border: 2px solid {purple};
1025
+ border-radius: 6px;
1026
+ padding: 2px 8px;
1027
+ color: {purple};
1028
+ font-weight: bold;
1029
+ font-size: 13px;
1030
+ font-family: 'Tahoma', sans-serif;
1031
+ box-shadow: 0 1px 3px rgba(0,0,0,0.2);
1032
+ ">
1033
+ مبدأ
1034
+ </div>
1035
+ </div>
1036
  """
1037
  )
1038
  ).add_to(m)
1039
 
1040
+ # 🚩 مقصد - پرچم + لیبل
1041
  folium.Marker(
1042
  location=destination,
1043
  tooltip="مقصد",
1044
  icon=folium.DivIcon(
1045
  html=f"""
1046
+ <div style="display: flex; align-items: center; direction: rtl;">
1047
  <div style="
1048
  width: 0;
1049
  height: 0;
1050
  border-top: 8px solid transparent;
1051
  border-bottom: 8px solid transparent;
1052
  border-left: 12px solid {purple};
1053
+ margin-left: 6px;
1054
+ box-shadow: 1px 1px 2px rgba(0,0,0,0.3);
1055
  "></div>
1056
+ <div style="
1057
+ background-color: white;
1058
+ border: 2px solid {purple};
1059
+ border-radius: 6px;
1060
+ padding: 2px 8px;
1061
+ color: {purple};
1062
+ font-weight: bold;
1063
+ font-size: 13px;
1064
+ font-family: 'Tahoma', sans-serif;
1065
+ box-shadow: 0 1px 3px rgba(0,0,0,0.2);
1066
+ ">
1067
+ مقصد
1068
+ </div>
1069
  </div>
1070
  """
1071
  )
1072
  ).add_to(m)
1073
 
1074
+ # خط مسیر
1075
  folium.PolyLine(
1076
  [origin, destination],
1077
  color=purple,