GSMEthesis commited on
Commit
a168835
·
verified ·
1 Parent(s): f748ca5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +47 -38
app.py CHANGED
@@ -996,76 +996,85 @@ def enhanced_likert_scale(question_data):
996
 
997
 
998
  def create_ride_map():
999
- """ایجاد نقشه سفر با ایکون‌های شبیه اسنپ اما با رنگ بنفش"""
1000
  origin = [35.7665280, 51.3300394] # پونک شمالی
1001
  destination = [35.7552343, 51.4204264] # پل طبیعت
1002
 
1003
  m = folium.Map(location=[(origin[0] + destination[0]) / 2, (origin[1] + destination[1]) / 2], zoom_start=13)
1004
 
1005
- # رنگ بنفش
1006
  purple = "#6a0dad"
1007
 
1008
- # آیکون مبدا
1009
  folium.Marker(
1010
  location=origin,
1011
  tooltip="مبدا",
1012
  icon=folium.DivIcon(
1013
  html=f"""
1014
- <div style="
1015
- display: flex;
1016
- justify-content: center;
1017
- align-items: center;
1018
- width: 50px;
1019
- height: 30px;
1020
- background-color: white;
1021
- border: 2px solid {purple};
1022
- border-radius: 6px;
1023
- color: {purple};
1024
- font-weight: bold;
1025
- font-size: 13px;
1026
- font-family: sans-serif;
1027
- box-shadow: 0 1px 3px rgba(0,0,0,0.3);
1028
- ">
1029
- مبدا
 
 
 
 
 
1030
  </div>
1031
  """
1032
  )
1033
  ).add_to(m)
1034
 
1035
- # آیکون مقصد
1036
  folium.Marker(
1037
  location=destination,
1038
  tooltip="مقصد",
1039
  icon=folium.DivIcon(
1040
  html=f"""
1041
- <div style="
1042
- display: flex;
1043
- justify-content: center;
1044
- align-items: center;
1045
- width: 50px;
1046
- height: 30px;
1047
- background-color: white;
1048
- border: 2px solid {purple};
1049
- border-radius: 6px;
1050
- color: {purple};
1051
- font-weight: bold;
1052
- font-size: 13px;
1053
- font-family: sans-serif;
1054
- box-shadow: 0 1px 3px rgba(0,0,0,0.3);
1055
- ">
1056
- مقصد
 
 
 
 
 
 
1057
  </div>
1058
  """
1059
  )
1060
  ).add_to(m)
1061
 
1062
- # خط مسیر بنفش
1063
  folium.PolyLine(
1064
  [origin, destination],
1065
  color=purple,
1066
  weight=4,
1067
  opacity=0.8,
1068
- dash_array="5, 5"
1069
  ).add_to(m)
1070
 
1071
  return m
 
996
 
997
 
998
  def create_ride_map():
 
999
  origin = [35.7665280, 51.3300394] # پونک شمالی
1000
  destination = [35.7552343, 51.4204264] # پل طبیعت
1001
 
1002
  m = folium.Map(location=[(origin[0] + destination[0]) / 2, (origin[1] + destination[1]) / 2], zoom_start=13)
1003
 
 
1004
  purple = "#6a0dad"
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: 12px;
1015
+ height: 12px;
1016
+ background-color: {purple};
1017
+ border-radius: 50%;
1018
+ margin-left: 6px;
1019
+ "></div>
1020
+ <div style="
1021
+ background-color: white;
1022
+ border: 2px solid {purple};
1023
+ border-radius: 6px;
1024
+ padding: 2px 8px;
1025
+ color: {purple};
1026
+ font-weight: bold;
1027
+ font-size: 13px;
1028
+ font-family: sans-serif;
1029
+ box-shadow: 0 1px 3px rgba(0,0,0,0.3);
1030
+ ">
1031
+ مبدا
1032
+ </div>
1033
  </div>
1034
  """
1035
  )
1036
  ).add_to(m)
1037
 
1038
+ # مقصد - آیکون پرچم + لیبل
1039
  folium.Marker(
1040
  location=destination,
1041
  tooltip="مقصد",
1042
  icon=folium.DivIcon(
1043
  html=f"""
1044
+ <div style="display: flex; align-items: center; direction: rtl;">
1045
+ <div style="
1046
+ width: 0;
1047
+ height: 0;
1048
+ border-left: 8px solid {purple};
1049
+ border-top: 6px solid transparent;
1050
+ border-bottom: 6px solid transparent;
1051
+ margin-left: 6px;
1052
+ "></div>
1053
+ <div style="
1054
+ background-color: white;
1055
+ border: 2px solid {purple};
1056
+ border-radius: 6px;
1057
+ padding: 2px 8px;
1058
+ color: {purple};
1059
+ font-weight: bold;
1060
+ font-size: 13px;
1061
+ font-family: sans-serif;
1062
+ box-shadow: 0 1px 3px rgba(0,0,0,0.3);
1063
+ ">
1064
+ مقصد
1065
+ </div>
1066
  </div>
1067
  """
1068
  )
1069
  ).add_to(m)
1070
 
1071
+ # خط بین مسیر
1072
  folium.PolyLine(
1073
  [origin, destination],
1074
  color=purple,
1075
  weight=4,
1076
  opacity=0.8,
1077
+ dash_array="5,5"
1078
  ).add_to(m)
1079
 
1080
  return m