Merge pull request #2620 from deathbaba/asd

release-60 branch fixes to master.
This commit is contained in:
Viktor Govako 2016-03-29 19:37:59 +03:00
commit 864d4c798e
121 changed files with 1657 additions and 2174 deletions

@ -1 +1 @@
Subproject commit 76f522e26615082160564da3c2a2e7092918e151
Subproject commit 4db9ea4cf4b58ee63f1d7f8ad2f79e72ce39bf1c

View file

@ -0,0 +1 @@
../../data/opening_hours_how_to_edit.html

View file

@ -994,4 +994,10 @@ Java_com_mapswithme_maps_Framework_nativeIsDownloadedMapAtScreenCenter(JNIEnv *,
::Framework * fr = frm();
return storage::IsPointCoveredByDownloadedMaps(fr->GetViewportCenter(), fr->Storage(), fr->CountryInfoGetter());
}
JNIEXPORT jstring JNICALL
Java_com_mapswithme_maps_Framework_nativeGetActiveObjectFormattedCuisine(JNIEnv * env, jclass)
{
return jni::ToJavaString(env, g_framework->GetPlacePageInfo().FormatCuisines());
}
} // extern "C"

View file

@ -314,4 +314,10 @@ Java_com_mapswithme_maps_editor_OpeningHours_nativeTimetablesToString(JNIEnv * e
sstr << MakeOpeningHours(tts).GetRule();
return jni::ToJavaString(env, sstr.str());
}
JNIEXPORT jboolean JNICALL
Java_com_mapswithme_maps_editor_OpeningHours_nativeIsTimetableStringValid(JNIEnv * env, jclass clazz, jstring jSource)
{
return OpeningHours(jni::ToNativeString(env, jSource)).IsValid();
}
} // extern "C"

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

View file

@ -2,7 +2,7 @@
<ripple
xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/bg_editor_light_night_pressed">
<item>
<item android:id="@android:id/mask">
<shape android:shape="rectangle">
<solid android:color="@color/bg_editor_light_night"/>
<corners android:radius="2dp"/>

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View file

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape android:shape="rectangle">
<solid android:color="@color/bg_editor_light_pressed"/>
<corners android:radius="2dp"/>
</shape>
</item>
<item>
<shape
android:shape="rectangle">
<solid android:color="@color/bg_editor_light"/>
<corners android:radius="2dp"/>
</shape>
</item>
</selector>

View file

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape android:shape="rectangle">
<solid android:color="@color/bg_editor_light_night_pressed"/>
<corners android:radius="2dp"/>
</shape>
</item>
<item>
<shape
android:shape="rectangle">
<solid android:color="@color/bg_editor_light_night"/>
<corners android:radius="2dp"/>
</shape>
</item>
</selector>

View file

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/bg_editor_light_night_pressed"
android:state_pressed="true"/>
<item android:drawable="@color/bg_editor_light_night"/>
</selector>

View file

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/base_accent_pressed"
android:state_pressed="true"/>
<item android:drawable="@color/base_accent"/>
</selector>

View file

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/bg_editor_login_fb_pressed"
android:state_pressed="true"/>
<item android:drawable="@color/bg_editor_login_fb"/>
</selector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 392 KiB

View file

@ -39,7 +39,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="@dimen/margin_base"
android:padding="@dimen/margin_half_plus"
tools:ignore="ScrollViewSize">
<LinearLayout
@ -75,46 +75,55 @@
android:id="@+id/first_osm_edit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/margin_base"
android:padding="@dimen/margin_half"
android:text="@string/you_have_edited_your_first_object"
android:layout_marginBottom="20dp"
android:text="@string/login_to_make_edits_visible"
android:textAppearance="@style/MwmTextAppearance.Body3.Light"/>
<Button
android:id="@+id/login_google"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/editor_auth_btn_height"
android:layout_marginBottom="@dimen/margin_half_plus"
android:background="?buttonLight"
android:drawableLeft="@drawable/ic_login_google"
android:drawableStart="@drawable/ic_login_google"
android:fontFamily="@string/robotoMedium"
android:paddingEnd="@dimen/margin_half"
android:paddingLeft="@dimen/margin_half"
android:paddingRight="@dimen/margin_half"
android:paddingStart="@dimen/margin_half"
android:text="@string/login_with_google"
android:textAllCaps="true"
android:textAppearance="@style/MwmTextAppearance.Body1"
tools:targetApi="jelly_bean"/>
android:layout_height="wrap_content"
android:orientation="horizontal"
tools:ignore="ButtonStyle">
<Button
android:id="@+id/login_facebook"
android:layout_width="match_parent"
android:layout_height="@dimen/editor_auth_btn_height"
android:layout_marginBottom="@dimen/margin_half_plus"
android:background="@color/bg_editor_login_fb"
android:drawableLeft="@drawable/ic_login_fb"
android:drawableStart="@drawable/ic_login_fb"
android:fontFamily="@string/robotoMedium"
android:paddingEnd="@dimen/margin_half"
android:paddingLeft="@dimen/margin_half"
android:paddingRight="@dimen/margin_half"
android:paddingStart="@dimen/margin_half"
android:text="@string/login_with_facebook"
android:textAllCaps="true"
android:textAppearance="@style/MwmTextAppearance.Body1.Light"
tools:targetApi="jelly_bean"/>
<Button
android:id="@+id/login_google"
android:layout_width="0dp"
android:layout_height="@dimen/editor_auth_btn_height"
android:layout_marginBottom="@dimen/margin_half_plus"
android:layout_marginEnd="@dimen/margin_half_plus"
android:layout_marginRight="@dimen/margin_half_plus"
android:layout_weight="1"
android:background="?buttonLight"
android:drawableLeft="@drawable/ic_login_google"
android:drawableStart="@drawable/ic_login_google"
android:fontFamily="@string/robotoMedium"
android:paddingEnd="@dimen/margin_half"
android:paddingLeft="@dimen/margin_half"
android:paddingRight="@dimen/margin_half"
android:paddingStart="@dimen/margin_half"
android:text="@string/google"
android:textAppearance="@style/MwmTextAppearance.Body1"
tools:targetApi="jelly_bean"/>
<Button
android:id="@+id/login_facebook"
android:layout_width="0dp"
android:layout_height="@dimen/editor_auth_btn_height"
android:layout_marginBottom="@dimen/margin_half_plus"
android:layout_weight="1"
android:background="@color/bg_editor_login_fb"
android:drawableLeft="@drawable/ic_login_fb"
android:drawableStart="@drawable/ic_login_fb"
android:fontFamily="@string/robotoMedium"
android:paddingEnd="@dimen/margin_half"
android:paddingLeft="@dimen/margin_half"
android:paddingRight="@dimen/margin_half"
android:paddingStart="@dimen/margin_half"
android:text="@string/facebook"
android:textAppearance="@style/MwmTextAppearance.Body1.Light"
tools:targetApi="jelly_bean"/>
</LinearLayout>
<Button
android:id="@+id/login_osm"
@ -122,7 +131,8 @@
android:layout_width="match_parent"
android:layout_height="@dimen/editor_auth_btn_height"
android:fontFamily="@string/robotoMedium"
android:text="@string/login_with_openstreetmap"
android:text="@string/openstreetmap"
android:textAllCaps="false"
android:textAppearance="@style/MwmTextAppearance.Body1.Light"
tools:targetApi="jelly_bean"/>
@ -130,9 +140,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_double"
android:padding="@dimen/margin_half"
android:text="@string/no_osm_account"
android:textAllCaps="true"
android:textAppearance="@style/MwmTextAppearance.Body3.Light"/>
<TextView
@ -141,7 +149,8 @@
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_half"
android:background="?clickableBackground"
android:padding="@dimen/margin_half"
android:paddingBottom="@dimen/margin_half"
android:paddingTop="@dimen/margin_half"
android:text="@string/register_at_openstreetmap"
android:textAllCaps="true"
android:textAppearance="@style/MwmTextAppearance.Body1.Light"/>

View file

@ -0,0 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/block_auth"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:minWidth="280dp"
android:orientation="vertical"
android:padding="@dimen/margin_base_plus">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/img_auth"/>
<TextView
android:id="@+id/first_osm_edit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/margin_base_plus"
android:layout_marginTop="20dp"
android:fontFamily="@string/robotoMedium"
android:gravity="center"
android:text="@string/login_to_make_edits_visible"
android:textColor="@color/text_dark"
android:textSize="@dimen/text_size_toolbar"
tools:ignore="UnusedAttribute"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/margin_half_plus"
android:orientation="horizontal"
tools:ignore="ButtonStyle">
<ImageButton
android:id="@+id/login_google"
android:layout_width="0dp"
android:layout_height="@dimen/editor_auth_btn_height"
android:layout_marginEnd="@dimen/margin_half_plus"
android:layout_marginRight="@dimen/margin_half_plus"
android:layout_weight="1"
android:background="@drawable/button_editor_light"
android:src="@drawable/ic_login_google"/>
<ImageButton
android:id="@+id/login_facebook"
android:layout_width="0dp"
android:layout_height="@dimen/editor_auth_btn_height"
android:layout_weight="1"
android:background="@drawable/com_facebook_button_background"
android:src="@drawable/ic_login_fb"/>
</LinearLayout>
<Button
android:id="@+id/login_osm"
style="@style/MwmWidget.Button.Accent"
android:layout_width="match_parent"
android:layout_height="@dimen/editor_auth_btn_height"
android:fontFamily="@string/robotoMedium"
android:text="OpenStreetMap"
android:textAllCaps="false"
android:textAppearance="@style/MwmTextAppearance.Body1.Light"
tools:ignore="HardcodedText"
tools:targetApi="jelly_bean"/>
<Button
android:id="@+id/register"
style="@style/MwmWidget.Button.Accent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_base"
android:background="?buttonLight"
android:fontFamily="@string/robotoMedium"
android:padding="@dimen/margin_quarter"
android:text="@string/register_at_openstreetmap"
android:textAppearance="@style/MwmTextAppearance.Body1"
tools:ignore="HardcodedText"
tools:targetApi="jelly_bean"/>
</LinearLayout>
</ScrollView>

View file

@ -37,7 +37,7 @@
android:gravity="center_horizontal"
android:layout_marginBottom="@dimen/margin_direction_small"
android:textSize="@dimen/text_direction_title"
tools:text="Place"/>
tools:text="Place, \n long, \n long"/>
<TextView
android:id="@+id/tv__straight_distance"

View file

@ -45,7 +45,7 @@
android:background="?clickableBackground"
android:gravity="end|center_vertical"
android:padding="@dimen/margin_half"
android:text="@string/tell_friends"
android:text="@string/share_with_friends"
android:textAppearance="@style/MwmTextAppearance.PlacePage.Accent"/>
<TextView

View file

@ -46,7 +46,7 @@
<RelativeLayout
android:id="@+id/examples"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:animateLayoutChanges="true">
<TextView
@ -67,16 +67,12 @@
android:layout_below="@id/tv__examples_title"
android:background="?dividerHorizontal"/>
<TextView
android:id="@+id/tv__examples"
<WebView
android:id="@+id/wv__examples"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/tv__examples_title"
android:fontFamily="@string/robotoMedium"
android:padding="@dimen/margin_base"
android:textAppearance="@style/MwmTextAppearance.Body3"
tools:ignore="UnusedAttribute"
tools:text="24/7 any non-stop facilities, 24 hours a day, 7 days a week;\n\nSa-Su 00:00-24:00 opens only the weekend but non-stop, 24 hours;\n\nsunrise-sunset."/>
android:padding="@dimen/margin_base"/>
</RelativeLayout>

View file

@ -8,11 +8,16 @@
<Button
android:id="@+id/btn__add_time"
android:layout_width="124dp"
android:layout_width="wrap_content"
android:layout_height="36dp"
android:layout_gravity="center"
android:background="@drawable/timetable_add_complement"
android:enabled="false"
android:minWidth="124dp"
android:paddingLeft="@dimen/margin_half"
android:paddingStart="@dimen/margin_half"
android:paddingRight="@dimen/margin_half"
android:paddingEnd="@dimen/margin_half"
android:text="@string/editor_time_add"
android:textAllCaps="true"
android:textAppearance="@style/MwmTextAppearance.Body3.Light"

View file

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/share_message"
android:title="@string/share_by_message"
android:icon="@drawable/ic_share_message"/>
<item android:id="@+id/share"
android:title="@string/share"
android:icon="@drawable/ic_share"/>
</menu>

View file

@ -692,8 +692,8 @@
<!-- Place Page opening hours text -->
<string name="daily">يوميا</string>
<string name="twentyfour_seven">ليلا ونهارا</string>
<string name="day_off_today">اليوم عطلة</string>
<string name="day_off">عطلة</string>
<string name="day_off_today">مغلق اليوم</string>
<string name="day_off">مغلق</string>
<string name="today">اليوم</string>
<string name="sunrise_to_sunset">من الشروق إلى المغيب</string>
<string name="sunset_to_sunrise">من غروب الشمس وحتى الشروق</string>

View file

@ -693,8 +693,8 @@
<!-- Place Page opening hours text -->
<string name="daily">Denně</string>
<string name="twentyfour_seven">Den a noc</string>
<string name="day_off_today">Dnes je den volna</string>
<string name="day_off">Den volna</string>
<string name="day_off_today">Dnes zavřeno</string>
<string name="day_off">Zavřeno</string>
<string name="today">Dnes</string>
<string name="sunrise_to_sunset">Od úsvitu do soumraku</string>
<string name="sunset_to_sunrise">Od západu do východu slunce</string>

View file

@ -708,8 +708,8 @@
<!-- Place Page opening hours text -->
<string name="daily">Täglich</string>
<string name="twentyfour_seven">Tag und Nacht</string>
<string name="day_off_today">Heute Ruhetag</string>
<string name="day_off">Ruhetag</string>
<string name="day_off_today">Heute geschlossen</string>
<string name="day_off">Geschlossen</string>
<string name="today">Heute</string>
<string name="sunrise_to_sunset">Von Sonnenauf- bis Sonnenuntergang</string>
<string name="sunset_to_sunrise">Von Sonnenuntergang bis Sonnenaufgang</string>

View file

@ -686,8 +686,8 @@
<!-- Place Page opening hours text -->
<string name="daily">Päivittäin</string>
<string name="twentyfour_seven">Päivin ja öin</string>
<string name="day_off_today">Vapaapäivä tänään</string>
<string name="day_off">Vapaapäivä</string>
<string name="day_off_today">Suljettu tänään</string>
<string name="day_off">Suljettu</string>
<string name="today">Tänään</string>
<string name="sunrise_to_sunset">Auringonnoususta auringonlaskuun</string>
<string name="sunset_to_sunrise">Auringonnoususta auringonlaskuun</string>

View file

@ -697,8 +697,8 @@
<!-- Place Page opening hours text -->
<string name="daily">Tous les jours</string>
<string name="twentyfour_seven">Jour et nuit</string>
<string name="day_off_today">Jour de fermeture aujourd\&#39;hui</string>
<string name="day_off">Jour de fermeture</string>
<string name="day_off_today">Fermé aujourd\&#39;hui</string>
<string name="day_off">Fermé</string>
<string name="today">Aujourd\&#39;hui</string>
<string name="sunrise_to_sunset">Du lever au coucher du soleil</string>
<string name="sunset_to_sunrise">Du coucher au lever du soleil</string>

View file

@ -687,8 +687,8 @@
<!-- Place Page opening hours text -->
<string name="daily">Naponta</string>
<string name="twentyfour_seven">Nappal és éjszaka</string>
<string name="day_off_today">Ma szabadnap</string>
<string name="day_off">Szabadnap</string>
<string name="day_off_today">Ma zárva</string>
<string name="day_off">Zárva</string>
<string name="today">Ma</string>
<string name="sunrise_to_sunset">Napkeltétől napnyugtáig</string>
<string name="sunset_to_sunrise">Napkeltétől napnyugtáig</string>

View file

@ -685,8 +685,8 @@
<!-- Place Page opening hours text -->
<string name="daily">Setiap Hari</string>
<string name="twentyfour_seven">siang dan malam</string>
<string name="day_off_today">Hari ini libur</string>
<string name="day_off">Libur</string>
<string name="day_off_today">Tutup hari ini</string>
<string name="day_off">Tutup</string>
<string name="today">Hari ini</string>
<string name="sunrise_to_sunset">Dari matahari terbit sampai matahari terbenam</string>
<string name="sunset_to_sunrise">Dari matahari terbenam sampai matahari terbit</string>

View file

@ -685,8 +685,8 @@
<!-- Place Page opening hours text -->
<string name="daily">Tutti i giorni</string>
<string name="twentyfour_seven">Giorno e notte</string>
<string name="day_off_today">Oggi giorno di riposo</string>
<string name="day_off">Giorno di riposo</string>
<string name="day_off_today">Oggi chiuso</string>
<string name="day_off">Chiuso</string>
<string name="today">Oggi</string>
<string name="sunrise_to_sunset">Dall\&#39;alba al tramonto</string>
<string name="sunset_to_sunrise">Dal tramonto all\&#39;alba</string>

View file

@ -685,8 +685,8 @@
<!-- Place Page opening hours text -->
<string name="daily">毎日</string>
<string name="twentyfour_seven">昼と夜</string>
<string name="day_off_today">今日は休み</string>
<string name="day_off">休み</string>
<string name="day_off_today">本日終業</string>
<string name="day_off">終業</string>
<string name="today">今日は</string>
<string name="sunrise_to_sunset">日の出から日没まで</string>
<string name="sunset_to_sunrise">日の出から日没まで</string>

View file

@ -678,8 +678,8 @@
<!-- Place Page opening hours text -->
<string name="daily">일별</string>
<string name="twentyfour_seven">24 시간</string>
<string name="day_off_today">오늘 휴가</string>
<string name="day_off">휴가</string>
<string name="day_off_today">오늘 영업 종료됨</string>
<string name="day_off">종료됨</string>
<string name="today">오늘</string>
<string name="sunrise_to_sunset">일출에서 일몰로</string>
<string name="sunset_to_sunrise">일출에서 일몰까지</string>

View file

@ -687,8 +687,8 @@
<!-- Place Page opening hours text -->
<string name="daily">Codziennie</string>
<string name="twentyfour_seven">Dzień i noc</string>
<string name="day_off_today">Dziś dzień wolny</string>
<string name="day_off">Dzień wolny</string>
<string name="day_off_today">Dziś nieczynne</string>
<string name="day_off">Nieczynne</string>
<string name="today">Dzisiaj</string>
<string name="sunrise_to_sunset">Od wschodu do zachodu słońca</string>
<string name="sunset_to_sunrise">Od zachodu do wschodu słońca</string>

View file

@ -683,8 +683,8 @@
<!-- Place Page opening hours text -->
<string name="daily">Zilnic</string>
<string name="twentyfour_seven">Zi și noapte</string>
<string name="day_off_today">Zi liberă azi</string>
<string name="day_off">Zi liberă</string>
<string name="day_off_today">Astăzi închis</string>
<string name="day_off">Închis</string>
<string name="today">Azi</string>
<string name="sunrise_to_sunset">De la răsărit până la apus</string>
<string name="sunset_to_sunrise">De la apus până la răsărit</string>

View file

@ -715,8 +715,8 @@
<!-- Place Page opening hours text -->
<string name="daily">Ежедневно</string>
<string name="twentyfour_seven">Круглосуточно</string>
<string name="day_off_today">Сегодня выходной</string>
<string name="day_off">Выходной</string>
<string name="day_off_today">Сегодня закрыто</string>
<string name="day_off">Закрыто</string>
<string name="today">Сегодня</string>
<string name="sunrise_to_sunset">От рассвета до заката</string>
<string name="sunset_to_sunrise">От заката до рассвета</string>

View file

@ -690,8 +690,8 @@
<!-- Place Page opening hours text -->
<string name="daily">ทุกวัน</string>
<string name="twentyfour_seven">ทั้งกลางวันและกลางคืน</string>
<string name="day_off_today">ปิดในวันนี้</string>
<string name="day_off">วันปิด</string>
<string name="day_off_today">วันนี้ปิด</string>
<string name="day_off">ปิด</string>
<string name="today">วันนี้</string>
<string name="sunrise_to_sunset">ตั้งแต่พระอาทิตย์ขึ้นจนพระอาทิตย์ตก</string>
<string name="sunset_to_sunrise">ตั้งแต่พระอาทิตย์ตกจนพระอาทิตย์ขึ้น</string>

View file

@ -692,8 +692,8 @@
<!-- Place Page opening hours text -->
<string name="daily">Günlük</string>
<string name="twentyfour_seven">Gündüz ve gece</string>
<string name="day_off_today">Bugün izin günü</string>
<string name="day_off">İzin günü</string>
<string name="day_off_today">Bugün kapalı</string>
<string name="day_off">Kapalı</string>
<string name="today">Bugün</string>
<string name="sunrise_to_sunset">Güneşin doğuşundan batışına kadar</string>
<string name="sunset_to_sunrise">Gün doğumundan gün batımına</string>

View file

@ -689,8 +689,8 @@
<!-- Place Page opening hours text -->
<string name="daily">Щоденно</string>
<string name="twentyfour_seven">Цілодобово</string>
<string name="day_off_today">Сьогодні вихідний</string>
<string name="day_off">Вихідний</string>
<string name="day_off_today">Сьогодні зачинено</string>
<string name="day_off">Зачинено</string>
<string name="today">Сьогодні</string>
<string name="sunrise_to_sunset">Від світанку до заходу</string>
<string name="sunset_to_sunrise">Від заходу до світанку</string>

View file

@ -672,8 +672,8 @@
<!-- Place Page opening hours text -->
<string name="daily">每天</string>
<string name="twentyfour_seven">白天和黑夜</string>
<string name="day_off_today">今天休息日</string>
<string name="day_off">休息日</string>
<string name="day_off_today">今天沒有營業</string>
<string name="day_off">沒有營業</string>
<string name="today">今天</string>
<string name="sunrise_to_sunset">從日出到日落</string>
<string name="sunset_to_sunrise">從日落到日出</string>

View file

@ -692,8 +692,8 @@
<!-- Place Page opening hours text -->
<string name="daily">每天</string>
<string name="twentyfour_seven">白天和黑夜</string>
<string name="day_off_today">今天休息日</string>
<string name="day_off">休息日</string>
<string name="day_off_today">今天没有营业</string>
<string name="day_off">没有营业</string>
<string name="today">今天</string>
<string name="sunrise_to_sunset">从日出到日落</string>
<string name="sunset_to_sunrise">从日落到日出</string>

View file

@ -105,9 +105,8 @@
<color name="bg_editor_add_disabled">#0C000000</color>
<color name="bg_editor_login_fb">#FF4861A3</color>
<color name="bg_editor_login_fb_pressed">#FF405792</color>
<color name="bg_editor_light">#FFF2F6F6</color>
<color name="bg_editor_light_pressed">#FFDCD9D9</color>
<!-- TODO yunikkk correct colors -->
<color name="bg_editor_light">#0C000000</color>
<color name="bg_editor_light_pressed">#3D000000</color>
<color name="bg_editor_light_night">#FFF2F6F6</color>
<color name="bg_editor_light_night_pressed">#FFDCD9D9</color>

View file

@ -8,6 +8,8 @@
<!-- App names -->
<string name="facebook" translatable="false">Facebook</string>
<string name="twitter" translatable="false">Twitter</string>
<string name="google" translatable="false">Google</string>
<string name="openstreetmap" translatable="false">OpenStreetMap</string>
<!-- Font names -->
<string name="robotoLight" translatable="false">sans-serif-light</string>

View file

@ -719,8 +719,8 @@
<!-- Place Page opening hours text -->
<string name="daily">Daily</string>
<string name="twentyfour_seven">24/7</string>
<string name="day_off_today">Day off today</string>
<string name="day_off">Day off</string>
<string name="day_off_today">Closed today</string>
<string name="day_off">Closed</string>
<string name="today">Today</string>
<string name="sunrise_to_sunset">From sunrise to sunset</string>
<string name="sunset_to_sunrise">From sunset to sunrise</string>

View file

@ -47,7 +47,6 @@
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:textAppearance">@style/MwmTextAppearance.Body1</item>
<item name="android:textColor">@color/timetable_add_complement_text</item>
</style>
<style name="MwmWidget.Editor.DayLayout">

View file

@ -54,7 +54,7 @@
<item name="accentButtonTextColorDisabled">@color/button_accent_text_disabled</item>
<item name="circleAccent">@drawable/circle_accent</item>
<item name="buttonLight">@drawable/editor_light_button</item>
<item name="buttonLight">@drawable/button_editor_light</item>
<item name="menuBackgroundClosed">@color/bg_menu_closed</item>
<item name="menuBackgroundOpen">@color/bg_menu_open</item>
@ -119,7 +119,7 @@
<item name="accentButtonTextColorDisabled">@color/button_accent_text_disabled_night</item>
<item name="circleAccent">@drawable/circle_accent_night</item>
<item name="buttonLight">@drawable/editor_light_button_night</item>
<item name="buttonLight">@drawable/button_editor_light_night</item>
<item name="menuBackgroundClosed">@color/bg_menu_closed_night</item>
<item name="menuBackgroundOpen">@color/bg_menu_open_night</item>

View file

@ -14,7 +14,7 @@
<header
android:id="@+id/osm_profile"
android:key="@string/pref_osm_profile"
android:title="OSM profile"/>
android:title="@string/osm_account"/>
<header
android:id="@+id/group_misc"

View file

@ -22,6 +22,7 @@ cp ../data/packed_polygons_obsolete.bin assets/
cp ../data/patterns.txt assets/
cp ../data/types.txt assets/
cp ../data/unicode_blocks.txt assets/
cp ../data/opening_hours_how_to_edit.html assets/
cp -r ../data/resources-hdpi_legacy/ assets/
cp -r ../data/resources-hdpi_dark/ assets/

View file

@ -189,9 +189,6 @@ public class Framework
public static native void nativeSet3dMode(boolean allow3d, boolean allow3dBuildings);
@Nullable
public static native MapObject nativeGetActiveMapObject();
@NonNull
public static native MapObject nativeDeleteBookmarkFromMapObject();
@ -202,4 +199,5 @@ public class Framework
public static native boolean nativeIsDownloadedMapAtScreenCenter();
public static native String nativeGetActiveObjectFormattedCuisine();
}

View file

@ -10,6 +10,7 @@ import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
@ -42,7 +43,7 @@ import com.mapswithme.maps.downloader.DownloaderFragment;
import com.mapswithme.maps.downloader.MapManager;
import com.mapswithme.maps.downloader.MigrationFragment;
import com.mapswithme.maps.downloader.OnmapDownloader;
import com.mapswithme.maps.editor.AuthFragment;
import com.mapswithme.maps.editor.AuthDialogFragment;
import com.mapswithme.maps.editor.Editor;
import com.mapswithme.maps.editor.EditorActivity;
import com.mapswithme.maps.editor.EditorHostFragment;
@ -110,7 +111,6 @@ public class MwmActivity extends BaseMwmFragmentActivity
MigrationFragment.class.getName(),
RoutingPlanFragment.class.getName(),
EditorHostFragment.class.getName(),
AuthFragment.class.getName(),
ReportFragment.class.getName() };
// Instance state
private static final String STATE_PP_OPENED = "PpOpened";
@ -407,9 +407,7 @@ public class MwmActivity extends BaseMwmFragmentActivity
if (Framework.nativeIsDownloadedMapAtScreenCenter())
startActivity(new Intent(MwmActivity.this, FeatureCategoryActivity.class));
else
// TODO uncomment
// UiUtils.showAlertDialog(getActivity(), R.string.message_invalid_feature_position);
UiUtils.showAlertDialog(getActivity(), R.string.invalid_username_or_password);
UiUtils.showAlertDialog(getActivity(), R.string.message_invalid_feature_position);
}
});
UiUtils.hide(mPositionChooser);
@ -1313,6 +1311,17 @@ public class MwmActivity extends BaseMwmFragmentActivity
}
}
public static class ShowAuthorizationTask implements MapTask
{
@Override
public boolean run(MwmActivity target)
{
final DialogFragment fragment = (DialogFragment) Fragment.instantiate(target, AuthDialogFragment.class.getName());
fragment.show(target.getSupportFragmentManager(), AuthDialogFragment.class.getName());
return true;
}
}
public void adjustCompass(int offsetX, int offsetY)
{
if (mMapFragment == null || !mMapFragment.isAdded())

View file

@ -34,6 +34,7 @@ public class BaseMwmDialogFragment extends DialogFragment
int style = getStyle();
int theme = getCustomTheme();
if (style != STYLE_NORMAL || theme != 0)
//noinspection WrongConstant
setStyle(style, theme);
}
@ -51,4 +52,9 @@ public class BaseMwmDialogFragment extends DialogFragment
super.onPause();
org.alohalytics.Statistics.logEvent("$onPause", getClass().getSimpleName());
}
public BaseMwmFragmentActivity getMwmActivity()
{
return (BaseMwmFragmentActivity) getActivity();
}
}

View file

@ -96,6 +96,9 @@ public enum BookmarkManager
public native void nativeShowBookmarkOnMap(int catId, int bmkId);
/**
* @return null, if wrong category is passed.
*/
public native @Nullable String nativeSaveToKmzFile(int catId, String tmpPath);
public native Bookmark nativeAddBookmarkToLastEditedCategory(String name, double lat, double lon);

View file

@ -6,12 +6,14 @@ import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;
import android.widget.EditText;
import android.widget.TextView;
import com.mapswithme.maps.R;
import com.mapswithme.maps.base.BaseMwmFragment;
import com.mapswithme.maps.editor.data.Timetable;
import com.mapswithme.util.Constants;
import com.mapswithme.util.Graphics;
import com.mapswithme.util.UiUtils;
@ -21,7 +23,7 @@ public class AdvancedTimetableFragment extends BaseMwmFragment
{
private boolean mIsExampleShown;
private EditText mInput;
private TextView mExample;
private WebView mExample;
private Timetable[] mInitTimetables;
private TextView mExamplesTitle;
@ -52,8 +54,8 @@ public class AdvancedTimetableFragment extends BaseMwmFragment
{
view.findViewById(R.id.examples).setOnClickListener(this);
mInput = (EditText) view.findViewById(R.id.et__timetable);
mExample = (TextView) view.findViewById(R.id.tv__examples);
// TODO set text of example from html stored in data/
mExample = (WebView) view.findViewById(R.id.wv__examples);
mExample.loadUrl(Constants.Url.OPENING_HOURS_MANUAL);
mExamplesTitle = (TextView) view.findViewById(R.id.tv__examples_title);
setExampleDrawables(R.drawable.ic_type_text, R.drawable.ic_expand_more);
}
@ -90,16 +92,14 @@ public class AdvancedTimetableFragment extends BaseMwmFragment
}
@Override
public Timetable[] getTimetables()
public String getTimetables()
{
if (mInput.length() == 0)
return OpeningHours.nativeGetDefaultTimetables();
return OpeningHours.nativeTimetablesFromString(mInput.getText().toString());
return mInput.getText().toString();
}
public void setTimetables(Timetable[] timetables)
public void setTimetables(String timetables)
{
mInitTimetables = timetables;
mInitTimetables = OpeningHours.nativeTimetablesFromString(timetables);
refreshTimetables();
}

View file

@ -0,0 +1,202 @@
package com.mapswithme.maps.editor;
import android.content.Intent;
import android.net.Uri;
import android.net.UrlQuerySanitizer;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.annotation.Size;
import android.support.v7.app.AlertDialog;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import com.mapswithme.maps.R;
import com.mapswithme.maps.base.BaseMwmDialogFragment;
import com.mapswithme.maps.widget.InputWebView;
import com.mapswithme.util.Constants;
import com.mapswithme.util.concurrency.ThreadPool;
import com.mapswithme.util.concurrency.UiThread;
import com.mapswithme.util.statistics.Statistics;
// TODO refactor together with with AuthFragment and BaseAuthFragment to avoid code duplication
public class AuthDialogFragment extends BaseMwmDialogFragment implements View.OnClickListener
{
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState)
{
return inflater.inflate(R.layout.fragment_auth_editor_dialog, container, false);
}
@Override
protected int getStyle()
{
return STYLE_NO_TITLE;
}
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState)
{
super.onViewCreated(view, savedInstanceState);
view.findViewById(R.id.login_osm).setOnClickListener(this);
view.findViewById(R.id.login_facebook).setOnClickListener(this);
view.findViewById(R.id.login_google).setOnClickListener(this);
view.findViewById(R.id.register).setOnClickListener(this);
}
@Override
public void onClick(View v)
{
// TODO show/hide spinners
switch (v.getId())
{
case R.id.login_osm:
Statistics.INSTANCE.trackAuthRequest(OsmOAuth.AuthType.OSM);
loginOsm();
break;
case R.id.login_facebook:
Statistics.INSTANCE.trackAuthRequest(OsmOAuth.AuthType.FACEBOOK);
loginWebview(OsmOAuth.AuthType.FACEBOOK);
break;
case R.id.login_google:
Statistics.INSTANCE.trackAuthRequest(OsmOAuth.AuthType.GOOGLE);
loginWebview(OsmOAuth.AuthType.GOOGLE);
break;
case R.id.lost_password:
Statistics.INSTANCE.trackEvent(Statistics.EventName.EDITOR_LOST_PASSWORD);
recoverPassword();
break;
case R.id.register:
Statistics.INSTANCE.trackEvent(Statistics.EventName.EDITOR_REG_REQUEST);
register();
break;
}
}
protected void loginOsm()
{
getMwmActivity().replaceFragment(OsmAuthFragment.class, null, null);
dismiss();
}
protected void loginWebview(final OsmOAuth.AuthType type)
{
final WebView webview = new InputWebView(getActivity());
final AlertDialog dialog = new AlertDialog.Builder(getActivity()).setView(webview).create();
ThreadPool.getWorker().execute(new Runnable()
{
@Override
public void run()
{
final String[] auth = (type == OsmOAuth.AuthType.FACEBOOK) ? OsmOAuth.nativeGetFacebookAuthUrl()
: OsmOAuth.nativeGetGoogleAuthUrl();
UiThread.run(new Runnable()
{
@Override
public void run()
{
if (isAdded())
loadWebviewAuth(dialog, webview, auth, type);
}
});
}
});
dialog.show();
}
protected void loadWebviewAuth(final AlertDialog dialog, final WebView webview, @Size(3) final String[] auth, final OsmOAuth.AuthType type)
{
if (auth == null)
{
// TODO show some dialog
return;
}
final String authUrl = auth[0];
webview.setWebViewClient(new WebViewClient()
{
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url)
{
if (OsmOAuth.shouldReloadWebviewUrl(url))
{
webview.loadUrl(authUrl);
}
else if (url.contains(OsmOAuth.URL_PARAM_VERIFIER))
{
finishWebviewAuth(auth[1], auth[2], getVerifierFromUrl(url), type);
dialog.cancel();
return true;
}
return false;
}
private String getVerifierFromUrl(String authUrl)
{
UrlQuerySanitizer sanitizer = new UrlQuerySanitizer();
sanitizer.setAllowUnregisteredParamaters(true);
sanitizer.parseUrl(authUrl);
return sanitizer.getValue(OsmOAuth.URL_PARAM_VERIFIER);
}
});
webview.loadUrl(authUrl);
}
protected void finishWebviewAuth(final String key, final String secret, final String verifier, final OsmOAuth.AuthType type)
{
ThreadPool.getWorker().execute(new Runnable() {
@Override
public void run()
{
final String[] auth = OsmOAuth.nativeAuthWithWebviewToken(key, secret, verifier);
UiThread.run(new Runnable() {
@Override
public void run()
{
processAuth(auth, type);
}
});
}
});
}
protected void recoverPassword()
{
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(Constants.Url.OSM_RECOVER_PASSWORD)));
}
protected void register()
{
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(Constants.Url.OSM_REGISTER)));
dismiss();
}
protected void processAuth(@Size(2) String[] auth, OsmOAuth.AuthType type)
{
if (auth == null)
{
if (isAdded())
{
new AlertDialog.Builder(getActivity()).setTitle(R.string.editor_login_error_dialog)
.setPositiveButton(android.R.string.ok, null).show();
Statistics.INSTANCE.trackEvent(Statistics.EventName.EDITOR_AUTH_REQUEST_RESULT,
Statistics.params().add(Statistics.EventParam.IS_SUCCESS, false).add(Statistics.EventParam.TYPE, type.name));
}
return;
}
OsmOAuth.setAuthorization(auth[0], auth[1]);
dismiss();
Statistics.INSTANCE.trackEvent(Statistics.EventName.EDITOR_AUTH_REQUEST_RESULT,
Statistics.params().add(Statistics.EventParam.IS_SUCCESS, true).add(Statistics.EventParam.TYPE, type.name));
}
}

View file

@ -63,19 +63,19 @@ public class AuthFragment extends BaseAuthFragment implements View.OnClickListen
switch (v.getId())
{
case R.id.login_osm:
Statistics.INSTANCE.trackEvent(Statistics.EventName.EDITOR_AUTH_REQUEST, Statistics.params().add(Statistics.EventParam.TYPE, AuthType.OSM.name));
Statistics.INSTANCE.trackAuthRequest(OsmOAuth.AuthType.OSM);
loginOsm();
break;
case R.id.login_facebook:
Statistics.INSTANCE.trackEvent(Statistics.EventName.EDITOR_AUTH_REQUEST, Statistics.params().add(Statistics.EventParam.TYPE, AuthType.FACEBOOK.name));
loginWebview(AuthType.FACEBOOK);
Statistics.INSTANCE.trackAuthRequest(OsmOAuth.AuthType.FACEBOOK);
loginWebview(OsmOAuth.AuthType.FACEBOOK);
break;
case R.id.login_google:
Statistics.INSTANCE.trackEvent(Statistics.EventName.EDITOR_AUTH_REQUEST, Statistics.params().add(Statistics.EventParam.TYPE, AuthType.GOOGLE.name));
loginWebview(AuthType.GOOGLE);
Statistics.INSTANCE.trackAuthRequest(OsmOAuth.AuthType.GOOGLE);
loginWebview(OsmOAuth.AuthType.GOOGLE);
break;
case R.id.lost_password:
Statistics.INSTANCE.trackEvent(Statistics.EventName.EDITOR_AUTH_REQUEST);
Statistics.INSTANCE.trackEvent(Statistics.EventName.EDITOR_LOST_PASSWORD);
recoverPassword();
break;
case R.id.register:
@ -90,7 +90,7 @@ public class AuthFragment extends BaseAuthFragment implements View.OnClickListen
getMwmActivity().replaceFragment(OsmAuthFragment.class, null, null);
}
protected void loginWebview(final AuthType type)
protected void loginWebview(final OsmOAuth.AuthType type)
{
final WebView webview = new InputWebView(getActivity());
final AlertDialog dialog = new AlertDialog.Builder(getActivity()).setView(webview).create();
@ -100,8 +100,8 @@ public class AuthFragment extends BaseAuthFragment implements View.OnClickListen
@Override
public void run()
{
final String[] auth = (type == AuthType.FACEBOOK) ? OsmOAuth.nativeGetFacebookAuthUrl()
: OsmOAuth.nativeGetGoogleAuthUrl();
final String[] auth = (type == OsmOAuth.AuthType.FACEBOOK) ? OsmOAuth.nativeGetFacebookAuthUrl()
: OsmOAuth.nativeGetGoogleAuthUrl();
UiThread.run(new Runnable()
{
@ -118,7 +118,7 @@ public class AuthFragment extends BaseAuthFragment implements View.OnClickListen
dialog.show();
}
protected void loadWebviewAuth(final AlertDialog dialog, final WebView webview, @Size(3) final String[] auth, final AuthType type)
protected void loadWebviewAuth(final AlertDialog dialog, final WebView webview, @Size(3) final String[] auth, final OsmOAuth.AuthType type)
{
if (auth == null)
{
@ -158,7 +158,7 @@ public class AuthFragment extends BaseAuthFragment implements View.OnClickListen
webview.loadUrl(authUrl);
}
protected void finishWebviewAuth(final String key, final String secret, final String verifier, final AuthType type)
protected void finishWebviewAuth(final String key, final String secret, final String verifier, final OsmOAuth.AuthType type)
{
ThreadPool.getWorker().execute(new Runnable() {
@Override

View file

@ -3,34 +3,20 @@ package com.mapswithme.maps.editor;
import android.support.annotation.Size;
import android.support.v7.app.AlertDialog;
import com.mapswithme.maps.R;
import com.mapswithme.maps.base.BaseMwmToolbarFragment;
import com.mapswithme.util.Utils;
import com.mapswithme.util.statistics.Statistics;
public abstract class BaseAuthFragment extends BaseMwmToolbarFragment
{
public enum AuthType
{
OSM("OSM"),
FACEBOOK("Facebook"),
GOOGLE("Google");
String name;
AuthType(String name)
{
this.name = name;
}
}
protected void processAuth(@Size(2) String[] auth, AuthType type)
protected void processAuth(@Size(2) String[] auth, OsmOAuth.AuthType type)
{
if (auth == null)
{
if (isAdded())
{
// TODO set correct text
new AlertDialog.Builder(getActivity()).setTitle("Auth error!")
new AlertDialog.Builder(getActivity()).setTitle(R.string.editor_login_error_dialog)
.setPositiveButton(android.R.string.ok, null).show();
Statistics.INSTANCE.trackEvent(Statistics.EventName.EDITOR_AUTH_REQUEST_RESULT,

View file

@ -1,15 +1,18 @@
package com.mapswithme.maps.editor;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.StringRes;
import android.support.v4.app.Fragment;
import android.support.v7.app.AlertDialog;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.mapswithme.maps.MwmApplication;
import com.mapswithme.maps.MwmActivity;
import com.mapswithme.maps.R;
import com.mapswithme.maps.base.BaseMwmToolbarFragment;
import com.mapswithme.maps.base.OnBackPressListener;
@ -24,7 +27,6 @@ import com.mapswithme.util.statistics.Statistics;
public class EditorHostFragment extends BaseMwmToolbarFragment
implements OnBackPressListener, View.OnClickListener
{
private static final String PREF_LAST_AUTH_DISPLAY_TIMESTAMP = "LastAuth";
private boolean mIsNewObject;
enum Mode
@ -160,9 +162,19 @@ public class EditorHostFragment extends BaseMwmToolbarFragment
switch (mMode)
{
case OPENING_HOURS:
final TimetableFragment fragment = (TimetableFragment) getChildFragmentManager().findFragmentByTag(TimetableFragment.class.getName());
Editor.setMetadata(Metadata.MetadataType.FMD_OPEN_HOURS, fragment.getTimetable());
editMapObject();
final String timetables = ((TimetableFragment) getChildFragmentManager().findFragmentByTag(TimetableFragment.class.getName())).getTimetable();
if (OpeningHours.nativeIsTimetableStringValid(timetables))
{
Editor.setMetadata(Metadata.MetadataType.FMD_OPEN_HOURS, timetables);
editMapObject();
}
else
{
new AlertDialog.Builder(getActivity())
.setMessage(R.string.editor_correct_mistake)
.setPositiveButton(android.R.string.ok, null)
.show();
}
break;
case STREET:
setStreet(((StreetFragment) getChildFragmentManager().findFragmentByTag(StreetFragment.class.getName())).getStreet());
@ -180,12 +192,22 @@ public class EditorHostFragment extends BaseMwmToolbarFragment
if (OsmOAuth.isAuthorized() || !ConnectionState.isConnected())
Utils.navigateToParent(getActivity());
else
showAuthorization();
{
final Activity parent = getActivity();
Intent intent = new Intent(parent, MwmActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
intent.putExtra(MwmActivity.EXTRA_TASK, new MwmActivity.ShowAuthorizationTask());
parent.startActivity(intent);
if (parent instanceof MwmActivity)
((MwmActivity) parent).customOnNavigateUp();
else
parent.finish();
}
}
else
{
Statistics.INSTANCE.trackEditorError(mIsNewObject);
// TODO(yunikkk) set correct error text.
UiUtils.showAlertDialog(getActivity(), R.string.downloader_no_space_title);
}
break;
@ -198,15 +220,4 @@ public class EditorHostFragment extends BaseMwmToolbarFragment
Editor.nativeSetStreet(street);
editMapObject();
}
private void showAuthorization()
{
if (!MwmApplication.prefs().contains(PREF_LAST_AUTH_DISPLAY_TIMESTAMP))
{
MwmApplication.prefs().edit().putLong(PREF_LAST_AUTH_DISPLAY_TIMESTAMP, System.currentTimeMillis()).apply();
getMwmActivity().replaceFragment(AuthFragment.class, null, null);
}
else
mToolbarController.onUpClick();
}
}

View file

@ -4,6 +4,8 @@ import android.support.annotation.IntRange;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import java.sql.Time;
import com.mapswithme.maps.editor.data.Timespan;
import com.mapswithme.maps.editor.data.Timetable;
@ -52,5 +54,12 @@ public final class OpeningHours
public static native Timetable[] nativeTimetablesFromString(String source);
@NonNull
public static native String nativeTimetablesToString(Timetable timetables[]);
public static native String nativeTimetablesToString(@NonNull Timetable[] timetables);
/**
* Sometimes timetables cannot be parsed with {@link #nativeTimetablesFromString} (hence can't be displayed in UI),
* but still are valid OSM timetables.
* @return true if timetable string is valid OSM timetable.
*/
public static native boolean nativeIsTimetableStringValid(String source);
}

View file

@ -120,7 +120,7 @@ public class OsmAuthFragment extends BaseAuthFragment implements View.OnClickLis
enableInput(true);
UiUtils.hide(mProgress);
mTvLogin.setText(R.string.login);
processAuth(auth, AuthType.OSM);
processAuth(auth, OsmOAuth.AuthType.OSM);
}
});
}

View file

@ -13,6 +13,20 @@ public final class OsmOAuth
{
private OsmOAuth() {}
public enum AuthType
{
OSM("OSM"),
FACEBOOK("Facebook"),
GOOGLE("Google");
public final String name;
AuthType(String name)
{
this.name = name;
}
}
// Result type corresponds to OsmOAuth::AuthResult.
@IntDef({OK, FAIL_COOKIE, FAIL_LOGIN, NO_O_AUTH, FAIL_AUTH, NO_ACCESS, NETWORK_ERROR, SERVER_ERROR})
public @interface AuthResult {}

View file

@ -59,9 +59,9 @@ public class SimpleTimetableAdapter extends RecyclerView.Adapter<SimpleTimetable
}
@Override
public Timetable[] getTimetables()
public String getTimetables()
{
return mItems.toArray(new Timetable[mItems.size()]);
return OpeningHours.nativeTimetablesToString(mItems.toArray(new Timetable[mItems.size()]));
}
@Override
@ -388,8 +388,11 @@ public class SimpleTimetableAdapter extends RecyclerView.Adapter<SimpleTimetable
@Override
void onBind()
{
add.setEnabled(mComplementItem != null && mComplementItem.weekdays.length != 0);
add.setText(TimeFormatUtils.formatWeekdays(mComplementItem));
final boolean enable = mComplementItem != null && mComplementItem.weekdays.length != 0;
final String text = mFragment.getString(R.string.editor_time_add);
add.setEnabled(enable);
add.setText(enable ? text + " (" + TimeFormatUtils.formatWeekdays(mComplementItem) + ")"
: text);
}
}
}

View file

@ -48,7 +48,7 @@ public class SimpleTimetableFragment extends BaseMwmRecyclerFragment
}
@Override
public Timetable[] getTimetables()
public String getTimetables()
{
return mAdapter.getTimetables();
}
@ -59,10 +59,10 @@ public class SimpleTimetableFragment extends BaseMwmRecyclerFragment
mAdapter.onHoursMinutesPicked(from, to, id);
}
public void setTimetables(Timetable[] tts)
public void setTimetables(String ttsString)
{
if (tts == null)
if (ttsString == null)
return;
mInitTts = tts;
mInitTts = OpeningHours.nativeTimetablesFromString(ttsString);
}
}

View file

@ -13,7 +13,6 @@ import android.widget.TextView;
import com.mapswithme.maps.R;
import com.mapswithme.maps.base.BaseMwmFragment;
import com.mapswithme.maps.base.OnBackPressListener;
import com.mapswithme.maps.editor.data.Timetable;
public class TimetableFragment extends BaseMwmFragment
implements View.OnClickListener,
@ -21,7 +20,7 @@ public class TimetableFragment extends BaseMwmFragment
{
interface TimetableProvider
{
Timetable[] getTimetables();
String getTimetables();
}
public static final String EXTRA_TIME = "Time";
@ -51,17 +50,18 @@ public class TimetableFragment extends BaseMwmFragment
mParent = (EditorHostFragment) getParentFragment();
initViews(view);
simpleMode();
mIsAdvancedMode = true;
switchMode();
final Bundle args = getArguments();
if (args != null && !TextUtils.isEmpty(args.getString(EXTRA_TIME)))
mSimpleModeFragment.setTimetables(OpeningHours.nativeTimetablesFromString(args.getString(EXTRA_TIME)));
mSimpleModeFragment.setTimetables(args.getString(EXTRA_TIME));
}
public String getTimetable()
{
return OpeningHours.nativeTimetablesToString(mIsAdvancedMode ? mAdvancedModeFragment.getTimetables()
: mSimpleModeFragment.getTimetables());
return mIsAdvancedMode ? mAdvancedModeFragment.getTimetables()
: mSimpleModeFragment.getTimetables();
}
private void initViews(View root)
@ -89,51 +89,40 @@ public class TimetableFragment extends BaseMwmFragment
private void switchMode()
{
if (mIsAdvancedMode)
simpleMode();
else
advancedMode();
}
private void simpleMode()
{
mIsAdvancedMode = false;
mSwitchMode.setText(R.string.editor_time_advanced);
final Timetable[] filledTimetables = getFilledTimetables(mAdvancedModeFragment, mAdvancedModeFragment);
mSimpleModeFragment = (SimpleTimetableFragment) attachFragment(mSimpleModeFragment, SimpleTimetableFragment.class.getName());
mSimpleModeFragment.setTimetables(filledTimetables);
}
private void advancedMode()
{
mIsAdvancedMode = true;
mSwitchMode.setText(R.string.editor_time_simple);
final Timetable[] filledTimetables = getFilledTimetables(mSimpleModeFragment, mSimpleModeFragment);
mAdvancedModeFragment = (AdvancedTimetableFragment) attachFragment(mAdvancedModeFragment, AdvancedTimetableFragment.class.getName());
mAdvancedModeFragment.setTimetables(filledTimetables);
}
private boolean hasFilledTimetables(Fragment fragment)
{
return fragment != null && fragment.isAdded();
}
@Nullable
private Timetable[] getFilledTimetables(Fragment fragment, TimetableProvider provider)
{
if (!hasFilledTimetables(fragment))
return null;
final Timetable[] timetables = provider.getTimetables();
if (timetables == null)
if (!mIsAdvancedMode)
{
new AlertDialog.Builder(getActivity())
.setMessage(R.string.editor_correct_mistake)
.create();
return null;
final String filledTimetables = mSimpleModeFragment != null ? mSimpleModeFragment.getTimetables()
: OpeningHours.nativeTimetablesToString(OpeningHours.nativeGetDefaultTimetables());
if (!OpeningHours.nativeIsTimetableStringValid(filledTimetables))
{
new AlertDialog.Builder(getActivity())
.setMessage(R.string.editor_correct_mistake)
.setPositiveButton(android.R.string.ok, null)
.show();
return;
}
mIsAdvancedMode = true;
mSwitchMode.setText(R.string.editor_time_advanced);
mAdvancedModeFragment = (AdvancedTimetableFragment) attachFragment(mAdvancedModeFragment, AdvancedTimetableFragment.class.getName());
mAdvancedModeFragment.setTimetables(filledTimetables);
}
else
{
final String filledTimetables = mAdvancedModeFragment != null ? mAdvancedModeFragment.getTimetables()
: OpeningHours.nativeTimetablesToString(OpeningHours.nativeGetDefaultTimetables());
if (!OpeningHours.nativeIsTimetableStringValid(filledTimetables))
{
new AlertDialog.Builder(getActivity())
.setMessage(R.string.editor_correct_mistake)
.setPositiveButton(android.R.string.ok, null)
.show();
return;
}
mIsAdvancedMode = false;
mSwitchMode.setText(R.string.editor_time_simple);
mSimpleModeFragment = (SimpleTimetableFragment) attachFragment(mSimpleModeFragment, SimpleTimetableFragment.class.getName());
mSimpleModeFragment.setTimetables(filledTimetables);
}
return timetables;
}
private Fragment attachFragment(Fragment current, String className)

View file

@ -2,12 +2,10 @@ package com.mapswithme.maps.editor;
import android.annotation.SuppressLint;
import android.app.Dialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v7.app.AlertDialog;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.TextView;
@ -16,9 +14,8 @@ import java.util.Random;
import com.mapswithme.maps.MwmApplication;
import com.mapswithme.maps.R;
import com.mapswithme.maps.base.BaseMwmDialogFragment;
import com.mapswithme.util.BottomSheetHelper;
import com.mapswithme.util.ConnectionState;
import com.mapswithme.util.sharing.ShareOption;
import com.mapswithme.util.sharing.SharingHelper;
import com.mapswithme.util.statistics.Statistics;
public class ViralFragment extends BaseMwmDialogFragment
@ -55,6 +52,7 @@ public class ViralFragment extends BaseMwmDialogFragment
public void onClick(View v)
{
share();
dismiss();
Statistics.INSTANCE.trackEvent(Statistics.EventName.EDITOR_SHARE_CLICK);
}
});
@ -64,7 +62,6 @@ public class ViralFragment extends BaseMwmDialogFragment
public void onClick(View v)
{
dismiss();
// TODO send statistics
}
});
return builder.setView(root).create();
@ -72,41 +69,7 @@ public class ViralFragment extends BaseMwmDialogFragment
private void share()
{
// TODO add custom sharing in twitter and url to facebook sharing
BottomSheetHelper.Builder sheet = BottomSheetHelper.create(getActivity())
.sheet(R.menu.menu_viral_editor)
.listener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item)
{
if (item.getItemId() == R.id.share_message)
{
ShareOption.SMS.share(getActivity(),
getString(R.string.whatsnew_editor_message_1));
}
else
{
ShareOption.ANY.share(getActivity(),
getString(R.string.whatsnew_editor_message_1),
R.string.editor_sharing_title);
}
dismiss();
return false;
}
});
if (!ShareOption.SMS.isSupported(getActivity()))
sheet.getMenu().removeItem(R.id.share_message);
sheet.tint().show();
}
@Override
public void onDismiss(DialogInterface dialog)
{
super.onDismiss(dialog);
// TODO remove before merge
SharingHelper.shareViralEditor(getActivity(), R.drawable.img_sharing_editor, R.string.editor_sharing_title, R.string.whatsnew_editor_message_1);
}
private void initViralText()

View file

@ -7,6 +7,7 @@ import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.widget.TextView;
import com.mapswithme.maps.Framework;
@ -17,6 +18,7 @@ import com.mapswithme.maps.bookmarks.data.MapObject;
import com.mapswithme.maps.location.LocationHelper;
import com.mapswithme.maps.widget.ArrowView;
import com.mapswithme.util.LocationUtils;
import com.mapswithme.util.UiUtils;
import com.mapswithme.util.statistics.AlohaHelper;
import com.mapswithme.util.statistics.Statistics;
@ -72,6 +74,16 @@ public class DirectionFragment extends BaseMwmDialogFragment implements Location
mTvTitle = (TextView) root.findViewById(R.id.tv__title);
mTvSubtitle = (TextView) root.findViewById(R.id.tv__subtitle);
mTvDistance = (TextView) root.findViewById(R.id.tv__straight_distance);
UiUtils.waitLayout(mTvTitle, new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout()
{
final int height = mTvTitle.getHeight();
final int lineHeight = mTvTitle.getLineHeight();
mTvTitle.setMaxLines(height / lineHeight);
}
});
}
public void setMapObject(MapObject object)

View file

@ -430,7 +430,7 @@ public class PlacePageView extends RelativeLayout implements View.OnClickListene
refreshMetadataOrHide(mMapObject.getMetadata(Metadata.MetadataType.FMD_PHONE_NUMBER), mPhone, mTvPhone);
refreshMetadataOrHide(mMapObject.getMetadata(Metadata.MetadataType.FMD_EMAIL), mEmail, mTvEmail);
refreshMetadataOrHide(mMapObject.getMetadata(Metadata.MetadataType.FMD_OPERATOR), mOperator, mTvOperator);
refreshMetadataOrHide(Editor.nativeGetFormattedCuisine(), mCuisine, mTvCuisine);
refreshMetadataOrHide(Framework.nativeGetActiveObjectFormattedCuisine(), mCuisine, mTvCuisine);
refreshMetadataOrHide(mMapObject.getMetadata(Metadata.MetadataType.FMD_WIKIPEDIA), mWiki, null);
refreshMetadataOrHide(mMapObject.getMetadata(Metadata.MetadataType.FMD_INTERNET), mWifi, null);
refreshMetadataOrHide(mMapObject.getMetadata(Metadata.MetadataType.FMD_FLATS), mEntrance, mTvEntrance);

View file

@ -30,6 +30,7 @@ public final class Constants
public static final String COPYRIGHT = "file:///android_asset/copyright.html";
public static final String FAQ = "file:///android_asset/faq.html";
public static final String OPENING_HOURS_MANUAL = "file:///android_asset/opening_hours_how_to_edit.html";
public static final String OSM_REGISTER = "https://www.openstreetmap.org/user/new";
public static final String OSM_RECOVER_PASSWORD = "https://www.openstreetmap.org/user/forgot-password";

View file

@ -2,9 +2,14 @@ package com.mapswithme.util;
import android.animation.Animator;
import android.app.Activity;
import android.content.ContentResolver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.net.Uri;
import android.os.Build;
import android.support.annotation.AnyRes;
import android.support.annotation.DimenRes;
import android.support.annotation.IdRes;
import android.support.annotation.NonNull;
@ -286,6 +291,15 @@ public final class UiUtils
: R.attr.accentButtonTextColorDisabled));
}
public static Uri getUriToResId(@NonNull Context context, @AnyRes int resId)
{
final Resources resources = context.getResources();
return Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://"
+ resources.getResourcePackageName(resId) + '/'
+ resources.getResourceTypeName(resId) + '/'
+ resources.getResourceEntryName(resId));
}
// utility class
private UiUtils() {}
}

View file

@ -12,9 +12,9 @@ import com.mapswithme.util.statistics.AlohaHelper;
public abstract class BaseShareable
{
private final Activity mActivity;
private Intent mBaseIntent;
private String mText;
private String mSubject;
protected Intent mBaseIntent;
protected String mText;
protected String mSubject;
public BaseShareable(Activity activity)
{

View file

@ -5,6 +5,8 @@ import android.content.Intent;
import android.net.Uri;
import android.support.annotation.Nullable;
import java.io.File;
public class LocalFileShareable extends BaseShareable
{
private final String mFileName;
@ -21,7 +23,7 @@ public class LocalFileShareable extends BaseShareable
protected void modifyIntent(Intent intent, @Nullable SharingTarget target)
{
super.modifyIntent(intent, target);
intent.putExtra(android.content.Intent.EXTRA_STREAM, Uri.parse("file://" + mFileName));
intent.putExtra(android.content.Intent.EXTRA_STREAM, Uri.fromFile(new File(mFileName)));
}
@Override

View file

@ -48,7 +48,7 @@ public abstract class ShareOption
public void share(Activity activity, String body)
{
Intent smsIntent = new Intent();
TargetUtils.fillSmsIntent(activity, smsIntent, body);
TargetUtils.fillSmsIntent(smsIntent, body);
activity.startActivity(smsIntent);
Statistics.INSTANCE.trackPlaceShared("SMS");
}

View file

@ -8,6 +8,7 @@ import android.content.SharedPreferences;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.support.annotation.DrawableRes;
import android.support.annotation.StringRes;
import android.text.TextUtils;
@ -86,7 +87,6 @@ public final class SharingHelper
mPrefs.edit().putString(PREFS_KEY_ITEMS, json).apply();
}
private static String guessAppName(PackageManager pm, ResolveInfo ri)
{
CharSequence name = ri.activityInfo.loadLabel(pm);
@ -110,7 +110,6 @@ public final class SharingHelper
PackageManager pm = MwmApplication.get().getPackageManager();
List<ResolveInfo> rlist = pm.queryIntentActivities(it, 0);
final List<SharingTarget> res = new ArrayList<>(rlist.size());
for (ResolveInfo ri : rlist)
{
@ -216,17 +215,20 @@ public final class SharingHelper
public static void shareBookmarksCategory(Activity context, int id)
{
String path = MwmApplication.get().getTempPath();
String name = BookmarkManager.INSTANCE.nativeSaveToKmzFile(id, path);
String name = BookmarkManager.INSTANCE.nativeSaveToKmzFile(id, MwmApplication.get().getTempPath());
if (name == null)
// some error occurred
return;
path += name + ".kmz";
// FIXME bug with "%s.kmz"
shareOutside(new LocalFileShareable(context, path, "application/vnd.google-earth.kmz")
.setText(R.string.share_bookmarks_email_body)
.setSubject(R.string.share_bookmarks_email_subject));
shareOutside(new LocalFileShareable(context, name + ".kmz", "application/vnd.google-earth.kmz")
.setText(R.string.share_bookmarks_email_body)
.setSubject(R.string.share_bookmarks_email_subject));
}
public static void shareViralEditor(Activity context, @DrawableRes int imageId, @StringRes int subject, @StringRes int text)
{
shareOutside(new ViralEditorShareable(context, imageId)
.setText(text)
.setSubject(subject));
}
}

View file

@ -1,10 +1,7 @@
package com.mapswithme.util.sharing;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.provider.Telephony;
final class TargetUtils
{
@ -16,18 +13,9 @@ final class TargetUtils
private TargetUtils() {}
public static void fillSmsIntent(Activity activity, Intent smsIntent, String body)
public static void fillSmsIntent(Intent smsIntent, String body)
{
smsIntent.setData(Uri.parse(URI_STRING_SMS));
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT)
{
final String defaultSms = Telephony.Sms.getDefaultSmsPackage(activity);
smsIntent.setType(TYPE_TEXT_PLAIN);
smsIntent.putExtra(EXTRA_SMS_TEXT, body);
if (defaultSms != null)
smsIntent.setPackage(defaultSms);
}
else
smsIntent.putExtra(EXTRA_SMS_BODY, body);
smsIntent.putExtra(EXTRA_SMS_BODY, body);
}
}

View file

@ -0,0 +1,84 @@
package com.mapswithme.util.sharing;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.support.annotation.DrawableRes;
import android.support.annotation.Nullable;
import java.util.Locale;
import com.facebook.FacebookSdk;
import com.facebook.share.model.ShareLinkContent;
import com.facebook.share.widget.ShareDialog;
import com.mapswithme.util.UiUtils;
public class ViralEditorShareable extends BaseShareable
{
private static final String FACEBOOK_SHARE_URL = "http://maps.me/fb-editor-v1?lang=" + Locale.getDefault().getLanguage();
private static final String VIRAL_TAIL = " http://maps.me/im_get";
private final Uri mUri;
public ViralEditorShareable(Activity context, @DrawableRes int resId)
{
super(context);
mUri = UiUtils.getUriToResId(context, resId);
}
@Override
protected void modifyIntent(Intent intent, @Nullable SharingTarget target)
{
super.modifyIntent(intent, target);
intent.putExtra(Intent.EXTRA_STREAM, mUri);
}
@Override
public String getMimeType()
{
return TargetUtils.TYPE_TEXT_PLAIN;
}
@Override
public void share(SharingTarget target)
{
Intent intent = getTargetIntent(target);
String lowerCaseName = target.activityName.toLowerCase();
if (lowerCaseName.contains("facebook"))
{
shareFacebook();
return;
}
setText(mText + VIRAL_TAIL);
if (lowerCaseName.contains("sms") || lowerCaseName.contains("mms"))
TargetUtils.fillSmsIntent(intent, mText);
else if (lowerCaseName.contains("twitter"))
setSubject("");
else if (!lowerCaseName.contains("mail"))
{
setText(mSubject + "\n" + mText);
setSubject("");
}
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
super.share(target);
}
private void shareFacebook()
{
FacebookSdk.sdkInitialize(getActivity());
ShareDialog shareDialog = new ShareDialog(getActivity());
if (ShareDialog.canShow(ShareLinkContent.class))
{
ShareLinkContent linkContent = new ShareLinkContent.Builder()
.setContentUrl(Uri.parse(FACEBOOK_SHARE_URL))
.build();
shareDialog.show(linkContent);
}
}
}

View file

@ -120,7 +120,7 @@ public enum Statistics
public static final String EDITOR_AUTH_REQUEST = "Editor_Auth_request";
public static final String EDITOR_AUTH_REQUEST_RESULT = "Editor_Auth_request_result";
public static final String EDITOR_REG_REQUEST = "Editor_Reg_request";
public static final String EDITOR_REG_RESULT = "Editor_Reg_request_result";
public static final String EDITOR_LOST_PASSWORD = "Editor_Lost_password";
public static final String EDITOR_SHARE_SHOW = "Editor_SecondTimeShare_show";
public static final String EDITOR_SHARE_CLICK = "Editor_SecondTimeShare_click";
public static final String EDITOR_REPORT = "Editor_Problem_report";
@ -380,6 +380,11 @@ public enum Statistics
.add(EventParam.IS_ONLINE, String.valueOf(ConnectionState.isConnected())));
}
public void trackAuthRequest(OsmOAuth.AuthType type)
{
trackEvent(EventName.EDITOR_AUTH_REQUEST, Statistics.params().add(Statistics.EventParam.TYPE, type.name));
}
public static ParameterBuilder params()
{
return new ParameterBuilder();

View file

@ -4354,7 +4354,7 @@ zh-Hans:3汽车修理店|服务站|
ar:محل صيانة السيارات|محطة خدمات
da:3Garage|3bilværksted|service station
tr:3Oto tamir dükkanı|servis istasyonu|araba
sv:3 bilreparatör|4servicestation|bil
sv:3Bilreparatör|4servicestation|bil
vi:Cửa hàng sửa chữa ô tô
id:Bengkel mobil
ro:Atelier de reparații auto
@ -5043,6 +5043,7 @@ en:Copy Shop|Printer
ru:Копировальный центр|печать|полиграфия
ar:محل نسخ|طباعة
cs:Kopírovací obchod|Tiskárny
da:Kopieringsbutik|Trykkeri
de:Kopierladen|Drucker
es:Copistería|imprenta|poligrafía
fi:Painotalo|Tulostaja
@ -5070,6 +5071,7 @@ en:Photo Shop|frames|shop
ru:Фототовары|магазин
ar:محل صور|إطارات|محل
cs:Fotografický obchod|rámy|obchod
da:Fotobutik|rammer|butik
de:Fotofachgeschäft|Rahmen|Geschäft
es:Artículos de fotografía|tienda
fi:Valokuvakauppa|kehykset|kauppa
@ -5080,6 +5082,7 @@ it:Negozio di fotografia|cornici|negozio
ja:写真屋|フレーム|店|買い物
ko:사진 상점|프레임|상점
nb:Fotobutikk|ramer|butikk
nl:Fotowinkel|kaders|winkel
pl:Fotograf|zdjęcia|punkt|sklep
pt:Artigos para fotografia|molduras|comércio|compras
ro:Centru fotografii|cadre|magazin
@ -5097,6 +5100,7 @@ en:Travel Agency|tours
ru:Турагентство|путешествия
ar:وكيل سفريات|جولات
cs:Cestovní kancelář|cesty
da:Rejsebureau|rundrejser
de:Reisebüro|Touren
es:Agencia de viajes|viajes
fi:Matkatoimisto|kiertueet
@ -5107,6 +5111,7 @@ it:Agenzia viaggi|tour
ja:旅行会社|ツアー
ko:여행사|투어
nb:Reisebyrå|rundreiser
nl:Reisagentschap|reizen
pl:Agencja turystyczna|wycieczki
pt:Agência de viagem|turismo
ro:Agenție de voiaj|tururi
@ -5124,6 +5129,7 @@ en:Outdoor Equipment|trekking|climbing|camping|shop
ru:Снаряжение|магазин
ar:معدات خارجية|ترحال|تسلق|تخييم|محل
cs:Venkovní vybavení|trekking|lezení|kempování|obchod
da:Fritidsudstyr|vandring|klatring|camping|butik
de:Outdoor-Ausrüstung|Trekking|Klettern|Camping|Geschäft
es:Equipamiento|tienda
fi:Ulkoiluvarusteet|vaellus|kiipeily|retkeily|kauppa
@ -5134,6 +5140,7 @@ it:Attrezzatura sportiva|trekking|arrampicata|campeggio|negozio
ja:アウトドア用品|トレッキング|クライミング|店|買い物
ko:야외 장비|트래킹|등반|캠핑|상점
nb:Fritidsutstyr|vandring|klatring|camping|butikk
nl:Outdooruitrusting|trekking|klimmen|kamperen|winkel
pl:Sprzęt turystyczny|wędrowanie|wspinaczka|camping|sklep
pt:Equipamentos esportivos|caminhada|escalada|camping|comércio|compras
ro:Echipament de exterior|trekking|cățărare|campare|magazin
@ -5151,6 +5158,7 @@ en:Dry Cleaning|cleaning
ru:Химчистка
ar:غسيل جاف|غسيل
cs:Chemické čištění|čistírna
da:Renseri|vaskeri
de:Chemische Reinigung|Reinigung
es:Tintorería
fi:Kuivapesula|siivous
@ -5161,6 +5169,7 @@ it:Lavaggio a secco|lavanderia
ja:クリーニング屋|クリーニング
ko:드라이 클리닝|청소
nb:Renseri|vaskeri
nl:Droogkuis|wassen
pl:Pralnia chemiczna|czyszczenie
pt:Lavagem a seco|lavanderia
ro:Curățătorie chimică|curățătorie
@ -5178,6 +5187,7 @@ en:Tyre Shop|shop
ru:Магазин шин|магазин
ar:محل إطارات|محل
cs:Obchod s pneumatikami|obchod
da:Dækforretning|butik
de:Reifen-Shop|Geschäft
es:Tienda de neumáticos|tienda
fi:Rengasliike|kauppa
@ -5188,6 +5198,7 @@ it:Gommista|negozio
ja:タイヤ専門店|ショップ|買い物
ko:타이어 상점|상점
nb:Dekkforretning|butikk
nl:Bandenwinkel|winkel
pl:Wulkanizacja|punkt
pt:Borracheiro|comércio|compras
ro:Magazin anvelope|magazin
@ -5205,6 +5216,7 @@ en:Car Wash
ru:Автомойка
ar:مغسلة سيارات
cs:Myčka aut
da:Bilvask
de:Autowäsche
es:Lavado de coches
fi:Autopesula
@ -5215,6 +5227,7 @@ it:Lavaggio auto
ja:洗車
ko:세차
nb:Bilvask
nl:Car wash
pl:Myjnia samochodowa
pt:Lavagem de veículos
ro:Spălătorie auto
@ -5232,6 +5245,7 @@ en:Veterinary Doctor
ru:Ветеринарная клиника
ar:طبيب بيطري
cs:Veterinář
da:Dyrlæge
de:Tierarzt
es:Clínica veterinaria
fi:Eläinlääkäri
@ -5242,6 +5256,7 @@ it:Veterinario
ja:獣医
ko:수의학 박사
nb:Veterinær
nl:Dierenarts
pl:Weterynarz
pt:Veterinário
ro:Cabinet veterinar
@ -5259,6 +5274,7 @@ en:Charging Station|charging
ru:Зарядная станция
ar:محطة شحن|شحن
cs:Nabíjecí stanice|nabíjení
da:Ladestation|opladning
de:Ladestation|Laden
es:Estación de carga
fi:Latausasema|lataus
@ -5269,6 +5285,7 @@ it:Stazione di ricarica|ricarica
ja:充電ステーション|充電
ko:충전 역|충전
nb:Ladestasjon|lading
nl:Oplaadstation|opladen
pl:Stacja ładowania|ładowanie
pt:Posto de combustível|abastecimento
ro:Stație încărcare|încărcare
@ -5286,6 +5303,7 @@ en:Nursery|Child Care
ru:Детская комната|ясли
ar:حضانة|رعاية أطفال
cs:Jesle|Péče o děti
da:Vuggestue|Børnehave
de:Kindergarten|Kinderbetreuung
es:Habitación infantil|guardería
fi:Päivähoito|Lastenhoito
@ -5296,6 +5314,7 @@ it:Asilo|cura dell'infanzia
ja:託児所|保育園
ko:보육|탁아
nb:Førskole|Barnehage
nl:Crèche|kinderzorg
pl:Żłobek|Przedszkole
pt:Creche|jardim de infância
ro:Grădiniță|Îngrijire copii

View file

@ -478,7 +478,6 @@ world +
heath -
lake -
land -
marsh -
meadow -
orchard -
peak -
@ -495,6 +494,7 @@ world +
waterfall -
wetland +
bog -
marsh -
{}
wood +
coniferous -

Binary file not shown.

File diff suppressed because it is too large Load diff

Binary file not shown.

File diff suppressed because it is too large Load diff

Binary file not shown.

File diff suppressed because it is too large Load diff

Binary file not shown.

View file

@ -41867,48 +41867,93 @@ cont {
}
}
}
cont {
name: "natural-wetland-marsh"
element {
scale: 14
area {
color: 10535864
priority: -16376
}
}
element {
scale: 15
area {
color: 10535864
priority: -16377
}
}
element {
scale: 16
area {
color: 10535864
priority: -16378
}
}
element {
scale: 17
area {
color: 10535864
priority: -16379
}
}
element {
scale: 18
area {
color: 10535864
priority: -16380
}
}
element {
scale: 19
area {
color: 10535864
priority: -16381
}
}
}
cont {
name: "natural-wood"
element {
scale: 10
area {
color: 11720357
priority: -16376
priority: -16382
}
}
element {
scale: 11
area {
color: 11720357
priority: -16377
priority: -16383
}
}
element {
scale: 12
area {
color: 11720357
priority: -16378
priority: -16384
}
}
element {
scale: 13
area {
color: 11720357
priority: -16379
priority: -16385
}
}
element {
scale: 14
area {
color: 11720357
priority: -16380
priority: -16386
}
}
element {
scale: 15
area {
color: 11720357
priority: -16381
priority: -16387
}
caption {
primary {
@ -41922,7 +41967,7 @@ cont {
scale: 16
area {
color: 11720357
priority: -16382
priority: -16388
}
caption {
primary {
@ -41937,7 +41982,7 @@ cont {
scale: 17
area {
color: 11720357
priority: -16383
priority: -16389
}
caption {
primary {
@ -41952,7 +41997,7 @@ cont {
scale: 18
area {
color: 11720357
priority: -16384
priority: -16390
}
caption {
primary {
@ -41967,7 +42012,7 @@ cont {
scale: 19
area {
color: 11720357
priority: -16385
priority: -16391
}
caption {
primary {
@ -41985,42 +42030,42 @@ cont {
scale: 10
area {
color: 11720357
priority: -16386
priority: -16392
}
}
element {
scale: 11
area {
color: 11720357
priority: -16387
priority: -16393
}
}
element {
scale: 12
area {
color: 11720357
priority: -16388
priority: -16394
}
}
element {
scale: 13
area {
color: 11720357
priority: -16389
priority: -16395
}
}
element {
scale: 14
area {
color: 11720357
priority: -16390
priority: -16396
}
}
element {
scale: 15
area {
color: 11720357
priority: -16391
priority: -16397
}
caption {
primary {
@ -42034,7 +42079,7 @@ cont {
scale: 16
area {
color: 11720357
priority: -16392
priority: -16398
}
caption {
primary {
@ -42049,7 +42094,7 @@ cont {
scale: 17
area {
color: 11720357
priority: -16393
priority: -16399
}
caption {
primary {
@ -42064,7 +42109,7 @@ cont {
scale: 18
area {
color: 11720357
priority: -16394
priority: -16400
}
caption {
primary {
@ -42079,7 +42124,7 @@ cont {
scale: 19
area {
color: 11720357
priority: -16395
priority: -16401
}
caption {
primary {
@ -42097,42 +42142,42 @@ cont {
scale: 10
area {
color: 11720357
priority: -16396
priority: -16402
}
}
element {
scale: 11
area {
color: 11720357
priority: -16397
priority: -16403
}
}
element {
scale: 12
area {
color: 11720357
priority: -16398
priority: -16404
}
}
element {
scale: 13
area {
color: 11720357
priority: -16399
priority: -16405
}
}
element {
scale: 14
area {
color: 11720357
priority: -16400
priority: -16406
}
}
element {
scale: 15
area {
color: 11720357
priority: -16401
priority: -16407
}
caption {
primary {
@ -42146,7 +42191,7 @@ cont {
scale: 16
area {
color: 11720357
priority: -16402
priority: -16408
}
caption {
primary {
@ -42161,7 +42206,7 @@ cont {
scale: 17
area {
color: 11720357
priority: -16403
priority: -16409
}
caption {
primary {
@ -42176,7 +42221,7 @@ cont {
scale: 18
area {
color: 11720357
priority: -16404
priority: -16410
}
caption {
primary {
@ -42191,7 +42236,7 @@ cont {
scale: 19
area {
color: 11720357
priority: -16405
priority: -16411
}
caption {
primary {
@ -42209,42 +42254,42 @@ cont {
scale: 10
area {
color: 11720357
priority: -16406
priority: -16412
}
}
element {
scale: 11
area {
color: 11720357
priority: -16407
priority: -16413
}
}
element {
scale: 12
area {
color: 11720357
priority: -16408
priority: -16414
}
}
element {
scale: 13
area {
color: 11720357
priority: -16409
priority: -16415
}
}
element {
scale: 14
area {
color: 11720357
priority: -16410
priority: -16416
}
}
element {
scale: 15
area {
color: 11720357
priority: -16411
priority: -16417
}
caption {
primary {
@ -42258,7 +42303,7 @@ cont {
scale: 16
area {
color: 11720357
priority: -16412
priority: -16418
}
caption {
primary {
@ -42273,7 +42318,7 @@ cont {
scale: 17
area {
color: 11720357
priority: -16413
priority: -16419
}
caption {
primary {
@ -42288,7 +42333,7 @@ cont {
scale: 18
area {
color: 11720357
priority: -16414
priority: -16420
}
caption {
primary {
@ -42303,7 +42348,7 @@ cont {
scale: 19
area {
color: 11720357
priority: -16415
priority: -16421
}
caption {
primary {
@ -46265,7 +46310,7 @@ cont {
scale: 14
area {
color: 14539465
priority: -16416
priority: -16422
}
caption {
primary {
@ -46279,7 +46324,7 @@ cont {
scale: 15
area {
color: 14539465
priority: -16417
priority: -16423
}
caption {
primary {
@ -46293,7 +46338,7 @@ cont {
scale: 16
area {
color: 14539465
priority: -16418
priority: -16424
}
caption {
primary {
@ -46307,7 +46352,7 @@ cont {
scale: 17
area {
color: 14539465
priority: -16419
priority: -16425
}
caption {
primary {
@ -46321,7 +46366,7 @@ cont {
scale: 18
area {
color: 14539465
priority: -16420
priority: -16426
}
caption {
primary {
@ -46335,7 +46380,7 @@ cont {
scale: 19
area {
color: 14539465
priority: -16421
priority: -16427
}
caption {
primary {
@ -47380,14 +47425,14 @@ cont {
scale: 11
area {
color: 14539465
priority: -16422
priority: -16428
}
}
element {
scale: 12
area {
color: 14539465
priority: -16423
priority: -16429
}
caption {
primary {
@ -47402,7 +47447,7 @@ cont {
scale: 13
area {
color: 14539465
priority: -16424
priority: -16430
}
caption {
primary {
@ -47424,7 +47469,7 @@ cont {
scale: 14
area {
color: 14539465
priority: -16425
priority: -16431
}
caption {
primary {
@ -47446,7 +47491,7 @@ cont {
scale: 15
area {
color: 14539465
priority: -16426
priority: -16432
}
caption {
primary {
@ -47468,7 +47513,7 @@ cont {
scale: 16
area {
color: 14539465
priority: -16427
priority: -16433
}
caption {
primary {
@ -47490,7 +47535,7 @@ cont {
scale: 17
area {
color: 14539465
priority: -16428
priority: -16434
}
caption {
primary {
@ -47512,7 +47557,7 @@ cont {
scale: 18
area {
color: 14539465
priority: -16429
priority: -16435
}
caption {
primary {
@ -47534,7 +47579,7 @@ cont {
scale: 19
area {
color: 14539465
priority: -16430
priority: -16436
}
caption {
primary {
@ -65419,21 +65464,21 @@ cont {
scale: 12
area {
color: 13626551
priority: -16431
priority: -16437
}
}
element {
scale: 13
area {
color: 13626551
priority: -16432
priority: -16438
}
}
element {
scale: 14
area {
color: 13626551
priority: -16433
priority: -16439
}
symbol {
name: "campsite"
@ -65444,7 +65489,7 @@ cont {
scale: 15
area {
color: 13626551
priority: -16434
priority: -16440
}
symbol {
name: "campsite"
@ -65455,7 +65500,7 @@ cont {
scale: 16
area {
color: 13626551
priority: -16435
priority: -16441
}
symbol {
name: "campsite"
@ -65529,35 +65574,35 @@ cont {
scale: 12
area {
color: 13626551
priority: -16436
priority: -16442
}
}
element {
scale: 13
area {
color: 13626551
priority: -16437
priority: -16443
}
}
element {
scale: 14
area {
color: 13626551
priority: -16438
priority: -16444
}
}
element {
scale: 15
area {
color: 13626551
priority: -16439
priority: -16445
}
}
element {
scale: 16
area {
color: 13626551
priority: -16440
priority: -16446
}
}
element {
@ -66058,35 +66103,35 @@ cont {
scale: 12
area {
color: 13626551
priority: -16441
priority: -16447
}
}
element {
scale: 13
area {
color: 13626551
priority: -16442
priority: -16448
}
}
element {
scale: 14
area {
color: 13626551
priority: -16443
priority: -16449
}
}
element {
scale: 15
area {
color: 13626551
priority: -16444
priority: -16450
}
}
element {
scale: 16
area {
color: 13626551
priority: -16445
priority: -16451
}
}
element {
@ -66221,35 +66266,35 @@ cont {
scale: 12
area {
color: 13626551
priority: -16446
priority: -16452
}
}
element {
scale: 13
area {
color: 13626551
priority: -16447
priority: -16453
}
}
element {
scale: 14
area {
color: 13626551
priority: -16448
priority: -16454
}
}
element {
scale: 15
area {
color: 13626551
priority: -16449
priority: -16455
}
}
element {
scale: 16
area {
color: 13626551
priority: -16450
priority: -16456
}
}
element {

View file

@ -202,7 +202,7 @@ highway|motorway_link;[highway=motorway_link];;name;int_name;201;
leisure|golf_course;[leisure=golf_course];;name;int_name;202;
highway|service|bridge;[highway=service][bridge?];;name;int_name;203;
power|minor_line;[power=minor_line];;name;int_name;204;
natural|marsh;[natural=marsh];;name;int_name;205;
natural|marsh;[natural=marsh];x;name;int_name;205;natural|wetland|marsh
leisure|stadium;[leisure=stadium];;name;int_name;206;
amenity|doctors;[amenity=doctors];;name;int_name;207;
railway|disused;[railway=disused];;name;int_name;208;
@ -1067,3 +1067,4 @@ amenity|car_wash;[amenity=car_wash];;name;int_name;1066;
amenity|veterinary;[amenity=veterinary];;name;int_name;1067;
amenity|charging_station;[amenity=charging_station];;name;int_name;1068;
amenity|childcare;[amenity=childcare];;name;int_name;1069;
natural|wetland|marsh;[natural=wetland][wetland=marsh];;name;int_name;1070;

1 building [building] addr:housenumber name 1
202 leisure|golf_course [leisure=golf_course] name int_name 202
203 highway|service|bridge [highway=service][bridge?] name int_name 203
204 power|minor_line [power=minor_line] name int_name 204
205 natural|marsh [natural=marsh] x name int_name 205 natural|wetland|marsh
206 leisure|stadium [leisure=stadium] name int_name 206
207 amenity|doctors [amenity=doctors] name int_name 207
208 railway|disused [railway=disused] name int_name 208
1067 amenity|veterinary [amenity=veterinary] name int_name 1067
1068 amenity|charging_station [amenity=charging_station] name int_name 1068
1069 amenity|childcare [amenity=childcare] name int_name 1069
1070 natural|wetland|marsh [natural=wetland][wetland=marsh] name int_name 1070

View file

@ -467,7 +467,7 @@ node|z15-[shop=bicycle], area|z15-[shop=bicycle] { icon-image: shop-bicycle-m.sv
node|z15-[shop=butcher], area|z15-[shop=butcher] { icon-image: butcher-m.svg; }
node|z15-[shop=car], area|z15-[shop=car] { icon-image: car_sharing-m.svg; }
node|z15-[shop=car_repair], area|z15-[shop=car_repair] { icon-image: car-repair-m.svg; }
node|z15-[amenity=car_wash], area|z15-[amenity=car_wash ] { icon-image: car_wash-m.svg; text-offset: 10; font-size: 11; text: name; text-color: @poi_label; z-index: 2400; }
node|z15-[amenity=car_wash], area|z15-[amenity=car_wash ] { icon-image: car-wash-m.svg; text-offset: 10; font-size: 11; text: name; text-color: @poi_label; z-index: 2400; }
node|z15-[shop=chemist], area|z15-[shop=chemist] { icon-image: chemist-m.svg; }
node|z15-[shop=clothes], area|z15-[shop=clothes] { icon-image: clothes-m.svg; }
node|z15-[shop=computer], area|z15-[shop=computer] { icon-image: computer-m.svg; }
@ -527,7 +527,7 @@ node|z17-[shop=bicycle], area|z17-[shop=bicycle]{ icon-image: shop-bicycle-l.svg
node|z17-[shop=butcher], area|z17-[shop=butcher] { icon-image: butcher-l.svg; }
node|z17-[shop=car], area|z17-[shop=car]{ icon-image: car_sharing-l.svg; }
node|z17-[shop=car_repair], area|z17-[shop=car_repair] { icon-image: car-repair-l.svg; }
node|z17-[amenity=car_wash], area|z17-[amenity=car_wash ] { icon-image: car_wash-l.svg; text-offset: 10; font-size: 11; text: name; text-color: @poi_label; z-index: 2400; }
node|z17-[amenity=car_wash], area|z17-[amenity=car_wash ] { icon-image: car-wash-l.svg; text-offset: 10; font-size: 11; text: name; text-color: @poi_label; z-index: 2400; }
node|z17-[shop=chemist], area|z17-[shop=chemist] { icon-image: chemist-l.svg; }
node|z17-[shop=clothes], area|z17-[shop=clothes] { icon-image: clothes-l.svg; }
node|z17-[shop=computer], area|z17-[shop=computer]{ icon-image: computer-l.svg; }

View file

@ -1517,9 +1517,7 @@ node|z16-[natural=bay],
area|z16-[natural=water],
area|z16-[natural=bay],
node|z16-[natural=wetland],
node|z16-[natural=marsh]
area|z16-[natural=wetland],
area|z16-[natural=marsh]
{
text: name;
font-size: 11;
@ -1562,22 +1560,15 @@ area|z12-[natural=water][bbox_area<10000000]
{}
*/
line[waterway] {
text-position: line;
z-index:10000;
line[waterway]
{
text-position: line;
z-index:10000;
}
line|z11-[waterway=river][!tunnel?] {
text: name;
font-size: 10;
text-color: @water_label;
text-halo-opacity: 0.1;
text-halo-color: @halo_water_lable;
text-halo-radius: 0;
z-index: 10000;
}
line|z11-[waterway=riverbank] {
line|z11-[waterway=river],
line|z11-[waterway=riverbank],
{
text: name;
font-size: 10;
text-color: @water_label;
@ -1588,7 +1579,8 @@ line|z11-[waterway=riverbank] {
}
line|z13-[waterway=riverbank],
line|z13-[waterway=river][!tunnel?] {
line|z13-[waterway=river],
{
text: name;
font-size: 10;
text-color: @water_label;
@ -1599,7 +1591,8 @@ line|z13-[waterway=river][!tunnel?] {
}
line|z13-[waterway=stream],
line|z13-[waterway=canal] {
line|z13-[waterway=canal],
{
text: name;
font-size: 10;
text-color: @water_label;
@ -1608,17 +1601,10 @@ line|z13-[waterway=canal] {
text-halo-radius: 0;
z-index: 10000;
}
line|z15-[waterway=river][!tunnel?] {
text: name;
font-size: 12;
text-color: @water_label;
text-halo-opacity: 0.1;
text-halo-color: @halo_water_lable;
text-halo-radius: 0;
z-index: 10000;
}
line|z15-[waterway=riverbank] {
line|z15-[waterway=river],
line|z15-[waterway=riverbank],
{
text: name;
font-size: 12;
text-color: @water_label;
@ -1629,7 +1615,8 @@ line|z15-[waterway=riverbank] {
}
line|z15-[waterway=stream],
line|z15-[waterway=canal] {
line|z15-[waterway=canal],
{
text: name;
font-size: 11;
text-color: @water_label;
@ -1638,17 +1625,10 @@ line|z15-[waterway=canal] {
text-halo-radius: 0;
z-index: 10000;
}
line|z17-[waterway=river][!tunnel?] {
text: name;
font-size: 12;
text-color: @water_label;
text-halo-opacity: 0.1;
text-halo-color: @halo_water_lable;
text-halo-radius: 0;
z-index: 10000;
}
line|z17-[waterway=riverbank] {
line|z17-[waterway=river],
line|z17-[waterway=riverbank],
{
text: name;
font-size: 12;
text-color: @water_label;
@ -1659,7 +1639,8 @@ line|z17-[waterway=riverbank] {
}
line|z17-[waterway=stream],
line|z17-[waterway=canal] {
line|z17-[waterway=canal],
{
text: name;
font-size: 11;
text-color: @water_label;
@ -1668,17 +1649,10 @@ line|z17-[waterway=canal] {
text-halo-radius: 0;
z-index: 10000;
}
line|z18-[waterway=river][!tunnel?] {
text: name;
font-size: 12;
text-color: @water_label;
text-halo-opacity: 0.1;
text-halo-color: @halo_water_lable;
text-halo-radius: 0;
z-index: 10000;
}
line|z18-[waterway=riverbank] {
line|z18-[waterway=river],
line|z18-[waterway=riverbank],
{
text: name;
font-size: 12;
text-color: @water_label;
@ -1689,7 +1663,8 @@ line|z18-[waterway=riverbank] {
}
line|z18-[waterway=stream],
line|z18-[waterway=canal] {
line|z18-[waterway=canal],
{
text: name;
font-size: 12;
text-color: @water_label;
@ -1698,6 +1673,14 @@ line|z18-[waterway=canal] {
text-halo-radius: 0;
z-index: 10000;
}
/* Do not draw tunnel waterways */
line[waterway][tunnel]
{
text: none;
}
/* FERRY */
line|z10-[route=ferry],

View file

@ -62,7 +62,6 @@ area|z0-[natural=salt_pond],
area|z0-[landuse=salt_pond],
area|z0-[waterway=dock],
area|z0-[waterway=riverbank],
area|z10-[waterway=river][!tunnel?],
area|z10-[natural=bay],
{
fill-color: @water;
@ -72,163 +71,151 @@ area|z10-[natural=bay],
area|z11-19[natural=wetland],
area|z11-19[natural=marsh] {
{
z-index: 49;
fill-opacity: 1;
fill-color: @wetland;
fill-position: background;
}
/* rivers */
line|z10[waterway=river][!tunnel?],
line|z10[waterway=riverbank] {
line|z10[waterway=river],
line|z10[waterway=riverbank],
{
width: 1;
opacity: 1;
color: @river;
z-index: 50;
-x-me-line-priority: -15800;
-x-me-line-priority: -15600;
}
line|z11-12[waterway=river][!tunnel?],
line|z11-12[waterway=riverbank] {
line|z11-12[waterway=river],
line|z11-12[waterway=riverbank],
{
width: 1.2;
opacity: 1;
color: @river;
z-index: 50;
-x-me-line-priority: -15800;
-x-me-line-priority: -15600;
}
line|z13[waterway=stream],
line|z13[waterway=canal]{
line|z13[waterway=canal],
{
width: 0.7;
opacity: 1;
color: @river;
z-index: 50;
-x-me-line-priority: -15800;
-x-me-line-priority: -15600;
}
line|z13[waterway=stream][intermittent=yes] {
line|z13[waterway=stream][intermittent=yes]
{
width: 0.7;
opacity: 1;
color: @river;
dashes: 2.7,2.7;
z-index: 49;
-x-me-line-priority: -15800;
-x-me-line-priority: -15600;
}
line|z13[waterway=river][!tunnel?] {
line|z13[waterway=river],
line|z13[waterway=riverbank],
{
width: 1.6;
opacity: 1;
color: @river;
z-index: 50;
-x-me-line-priority: -15800;
-x-me-line-priority: -15600;
}
line|z13[waterway=riverbank] {
width: 1.6;
opacity: 1;
color: @river;
z-index: 50;
-x-me-line-priority: -15800;
}
line|z14[waterway=stream],
line|z14[waterway=canal]{
line|z14[waterway=canal],
{
width: 1;
opacity: 1;
color: @river;
z-index: 50;
-x-me-line-priority: -15800;
-x-me-line-priority: -15600;
}
line|z14[waterway=stream][intermittent=yes] {
line|z14[waterway=stream][intermittent=yes]
{
width: 1;
opacity: 1;
color: @river;
dashes: 2.7,2.7;
z-index: 49;
-x-me-line-priority: -15800;
-x-me-line-priority: -15600;
}
line|z14[waterway=river][!tunnel?]{
line|z14[waterway=river],
line|z14[waterway=riverbank],
{
width: 1.8;
opacity: 1;
color: @river;
z-index: 50;
-x-me-line-priority: -15800;
-x-me-line-priority: -15600;
}
line|z14[waterway=riverbank] {
width: 1.8;
opacity: 1;
color: @river;
z-index: 50;
-x-me-line-priority: -15800;
}
line|z15-[waterway=stream],
line|z15-[waterway=canal]
{
line|z15-[waterway=canal],
{
width: 1.6;
opacity: 1;
color: @river;
z-index: 50;
-x-me-line-priority: -15800;
-x-me-line-priority: -15600;
}
line|z15-[waterway=stream][intermittent=yes] {
line|z15-[waterway=stream][intermittent=yes]
{
dashes: 4.95;
width: 1.4;
opacity: 1;
color: @river;
z-index: 49;
-x-me-line-priority: -15800;
-x-me-line-priority: -15600;
}
line|z15-[waterway=river][!tunnel?] {
line|z15-[waterway=river],
line|z15-[waterway=riverbank],
{
width: 2.2;
color: @river;
z-index: 50;
-x-me-line-priority: -15800;
-x-me-line-priority: -15600;
}
line|z15-[waterway=riverbank] {
width: 2.2;
color: @river;
z-index: 50;
-x-me-line-priority: -15800;
}
area|z15-[waterway=dam],
line|z15-[waterway=dam],
line|z15-[waterway=weir],
{
{
width: 1;
opacity: 1;
color: @bridge_casing;
z-index: 110;
}
line|z16-[waterway=canal],
node|z16-[waterway=lock]
line|z16-[waterway=lock],
{
width: 1.5;
color: @river;
z-index: 50;
-x-me-line-priority: -15800;
-x-me-line-priority: -15600;
}
node|z16-[waterway=lock_gate],
{
{
icon-image: dot-m.svg;
z-index: 110;
}
line|z17-[waterway=ditch],
line|z17-[waterway=drain] {
line|z17-[waterway=drain],
{
width: 1.8;
opacity: 1;
color: @river;
@ -236,6 +223,13 @@ line|z17-[waterway=drain] {
dashes: 0.9,0.9;
}
/* Do not draw tunnel waterways */
line[waterway][tunnel]
{
width: 0;
}
/* VEGETATION */
area|z10[natural=wood],

View file

@ -202,7 +202,7 @@ highway|motorway_link
leisure|golf_course
highway|service|bridge
power|minor_line
natural|marsh
natural|wetland|marsh
leisure|stadium
amenity|doctors
railway|disused
@ -1067,3 +1067,4 @@ amenity|car_wash
amenity|veterinary
amenity|charging_station
amenity|childcare
natural|wetland|marsh

View file

@ -478,7 +478,6 @@ world 00000000000000000000 +
heath 00000000000011111111 -
lake 11111111111111111111 -
land 00000011111111111111 -
marsh 00000000000000000000 -
meadow 00000000000000011111 -
orchard 00000000000000011111 -
peak 00000000000011111111 -
@ -495,6 +494,7 @@ world 00000000000000000000 +
waterfall 00000000000000111111 -
wetland 00000000000000111111 +
bog 00000000000011111111 -
marsh 00000000000000111111 -
{}
wood 00000000001111111111 +
coniferous 00000000001111111111 -

View file

@ -48,6 +48,8 @@ public:
XMLFeature(pugi::xml_document const & xml);
XMLFeature(pugi::xml_node const & xml);
XMLFeature(XMLFeature const & feature);
// TODO: It should make "deep" compare instead of converting to strings.
// Strings comparison does not work if tags order is different but tags are equal.
bool operator==(XMLFeature const & other) const;
/// @returns nodes and ways from osmXml. Vector can be empty.
static vector<XMLFeature> FromOSM(string const & osmXml);

View file

@ -105,7 +105,7 @@ void FeatureType::ReplaceBy(osm::EditableMapObject const & emo)
m_id = emo.GetID();
}
editor::XMLFeature FeatureType::ToXML() const
editor::XMLFeature FeatureType::ToXML(bool serializeType) const
{
editor::XMLFeature feature(GetFeatureType() == feature::GEOM_POINT
? editor::XMLFeature::Type::Node
@ -139,32 +139,35 @@ editor::XMLFeature FeatureType::ToXML() const
// feature.m_params.layer =
// feature.m_params.rank =
feature::TypesHolder th(*this);
// TODO(mgsergio): Use correct sorting instead of SortBySpec based on the config.
th.SortBySpec();
Classificator & cl = classif();
// TODO(mgsergio): Either improve "OSM"-compatible serialization for more complex types,
// or save all our types directly, to restore and reuse them in migration of modified features.
for (uint32_t const type : th)
if (serializeType)
{
string const strType = cl.GetReadableObjectName(type);
strings::SimpleTokenizer iter(strType, "-");
string const k = *iter;
if (++iter)
feature::TypesHolder th(*this);
// TODO(mgsergio): Use correct sorting instead of SortBySpec based on the config.
th.SortBySpec();
Classificator & cl = classif();
// TODO(mgsergio): Either improve "OSM"-compatible serialization for more complex types,
// or save all our types directly, to restore and reuse them in migration of modified features.
for (uint32_t const type : th)
{
// First (main) type is always stored as "k=amenity v=restaurant".
// Any other "k=amenity v=atm" is replaced by "k=atm v=yes".
if (feature.GetTagValue(k).empty())
feature.SetTagValue(k, *iter);
string const strType = cl.GetReadableObjectName(type);
strings::SimpleTokenizer iter(strType, "-");
string const k = *iter;
if (++iter)
{
// First (main) type is always stored as "k=amenity v=restaurant".
// Any other "k=amenity v=atm" is replaced by "k=atm v=yes".
if (feature.GetTagValue(k).empty())
feature.SetTagValue(k, *iter);
else
feature.SetTagValue(*iter, "yes");
}
else
feature.SetTagValue(*iter, "yes");
}
else
{
// We're editing building, generic craft, shop, office, amenity etc.
// Skip it's serialization.
// TODO(mgsergio): Correcly serialize all types back and forth.
LOG(LDEBUG, ("Skipping type serialization:", k));
{
// We're editing building, generic craft, shop, office, amenity etc.
// Skip it's serialization.
// TODO(mgsergio): Correcly serialize all types back and forth.
LOG(LDEBUG, ("Skipping type serialization:", k));
}
}
}

View file

@ -170,7 +170,10 @@ public:
/// Replaces all FeatureType's components.
void ReplaceBy(osm::EditableMapObject const & ef);
editor::XMLFeature ToXML() const;
/// @param serializeType if false, types are not serialized.
/// Useful for applying modifications to existing OSM features, to avoid ussues when someone
/// has changed a type in OSM, but our users uploaded invalid outdated type after modifying feature.
editor::XMLFeature ToXML(bool serializeType) const;
/// Creates new feature, including geometry and types.
/// @Note: only nodes (points) are supported at the moment.
bool FromXML(editor::XMLFeature const & xml);

View file

@ -3,10 +3,6 @@
#include "indexer/classificator_loader.hpp"
#include "indexer/feature.hpp"
#include "base/string_utils.hpp"
#include "std/sstream.hpp"
/*
namespace
{
struct TestSetUp
@ -15,77 +11,33 @@ struct TestSetUp
};
TestSetUp g_testSetUp;
// Sort tags and compare as strings.
void CompareFeatureXML(string const & d1, string const & d2)
{
pugi::xml_document xml1, xml2;
xml1.load(d1.data());
xml2.load(d2.data());
xml1.child("node").remove_attribute("timestamp");
xml2.child("node").remove_attribute("timestamp");
stringstream ss1, ss2;
xml1.save(ss1);
xml2.save(ss2);
vector<string> v1(strings::SimpleTokenizer(ss1.str(), "\n"), strings::SimpleTokenizer());
vector<string> v2(strings::SimpleTokenizer(ss2.str(), "\n"), strings::SimpleTokenizer());
TEST(v1.size() >= 3, ());
TEST(v2.size() >= 3, ());
// Sort all except <xml ...>, <node ...> and </node>
sort(begin(v1) + 2, end(v1) - 1);
sort(begin(v2) + 2, end(v2) - 1);
// Format back to string to have a nice readable error message.
auto s1 = strings::JoinStrings(v1, "\n");
auto s2 = strings::JoinStrings(v2, "\n");
TEST_EQUAL(s1, s2, ());
}
} // namespace
TODO(mgsergio): Unkomment when creation is required.
UNIT_TEST(FeatureType_FromXMLAndBackToXML)
{
auto const xml = R"(<?xml version="1.0"?>
<node
lat="55.7978998"
lon="37.474528"
timestamp="2015-11-27T21:13:32Z">
<tag
k="name"
v="Gorki Park" />
<tag
k="name:en"
v="Gorki Park" />
<tag
k="name:ru"
v="Парк Горького" />
<tag
k="addr:housenumber"
v="10" />
<tag
k="opening_hours"
v="Mo-Fr 08:15-17:30" />
<tag
k="amenity"
v="atm" />
<tag
k="mapswithme:geom_type"
v="GEOM_POINT" />
</node>
)";
auto const feature = FeatureType::FromXML(xml);
auto const xmlFeature = feature.ToXML();
UNIT_TEST(FeatureType_FromXMLAndBackToXML)
{
string const xmlNoTypeStr = R"(<?xml version="1.0"?>
<node lat="55.7978998" lon="37.474528" timestamp="2015-11-27T21:13:32Z">
<tag k="name" v="Gorki Park" />
<tag k="name:en" v="Gorki Park" />
<tag k="name:ru" v="Парк Горького" />
<tag k="addr:housenumber" v="10" />
</node>
)";
stringstream sstr;
xmlFeature.Save(sstr);
char const kTimestamp[] = "2015-11-27T21:13:32Z";
CompareFeatureXML(xml, sstr.str());
}
*/
editor::XMLFeature xmlNoType(xmlNoTypeStr);
editor::XMLFeature xmlWithType = xmlNoType;
xmlWithType.SetTagValue("amenity", "atm");
FeatureType ft;
ft.FromXML(xmlWithType);
auto fromFtWithType = ft.ToXML(true);
fromFtWithType.SetAttribute("timestamp", kTimestamp);
TEST_EQUAL(fromFtWithType, xmlWithType, ());
auto fromFtWithoutType = ft.ToXML(false);
fromFtWithoutType.SetAttribute("timestamp", kTimestamp);
TEST_EQUAL(fromFtWithoutType, xmlNoType, ());
}

View file

@ -277,7 +277,7 @@ bool Editor::Save(string const & fullFilePath) const
{
FeatureTypeInfo const & fti = index.second;
// TODO: Do we really need to serialize deleted features in full details? Looks like mwm ID and meta fields are enough.
XMLFeature xf = fti.m_feature.ToXML();
XMLFeature xf = fti.m_feature.ToXML(true /*type serializing helps during migration*/);
xf.SetMWMFeatureIndex(index.first);
if (!fti.m_street.empty())
xf.SetTagValue(kAddrStreetTag, fti.m_street);
@ -583,18 +583,17 @@ void Editor::UploadChanges(string const & key, string const & secret, TChangeset
try
{
XMLFeature feature = fti.m_feature.ToXML();
if (!fti.m_street.empty())
feature.SetTagValue(kAddrStreetTag, fti.m_street);
ourDebugFeatureString = DebugPrint(feature);
switch (fti.m_status)
{
case FeatureStatus::Untouched: CHECK(false, ("It's impossible.")); continue;
case FeatureStatus::Created:
{
XMLFeature feature = fti.m_feature.ToXML(true);
if (!fti.m_street.empty())
feature.SetTagValue(kAddrStreetTag, fti.m_street);
ourDebugFeatureString = DebugPrint(feature);
ASSERT_EQUAL(feature.GetType(), XMLFeature::Type::Node,
("Linear and area features creation is not supported yet."));
try
@ -624,7 +623,7 @@ void Editor::UploadChanges(string const & key, string const & secret, TChangeset
}
catch (...)
{
// Pas network or other errors to outside exception handler.
// Pass network or other errors to outside exception handler.
throw;
}
}
@ -632,6 +631,13 @@ void Editor::UploadChanges(string const & key, string const & secret, TChangeset
case FeatureStatus::Modified:
{
// Do not serialize feature's type to avoid breaking OSM data.
// TODO: Implement correct types matching when we support modifying existing feature types.
XMLFeature feature = fti.m_feature.ToXML(false);
if (!fti.m_street.empty())
feature.SetTagValue(kAddrStreetTag, fti.m_street);
ourDebugFeatureString = DebugPrint(feature);
XMLFeature osmFeature =
GetMatchingFeatureFromOSM(changeset, m_getOriginalFeatureFn(fti.m_feature.GetID()));
XMLFeature const osmFeatureCopy = osmFeature;

View file

@ -140,7 +140,7 @@ using namespace osm;
catch (exception const & ex)
{
LOG(LWARNING, ("Error login", ex.what()));
[Statistics logEvent:@"Editor_Reg_request_result" withParameters:@{kStatIsSuccess : kStatNo,
[Statistics logEvent:@"Editor_Auth_request_result" withParameters:@{kStatIsSuccess : kStatNo,
kStatErrorData : @(ex.what()),
kStatType : kStatOSM}];
}
@ -150,7 +150,7 @@ using namespace osm;
if (auth.IsAuthorized())
{
osm_auth_ios::AuthorizationStoreCredentials(auth.GetKeySecret());
[Statistics logEvent:@"Editor_Reg_request_result" withParameters:@{kStatIsSuccess : kStatYes,
[Statistics logEvent:@"Editor_Auth_request_result" withParameters:@{kStatIsSuccess : kStatYes,
kStatType : kStatOSM}];
UIViewController * svc = nil;
for (UIViewController * vc in self.navigationController.viewControllers)

View file

@ -159,7 +159,7 @@ NSString * getVerifier(NSString * urlString)
catch (exception const & ex)
{
LOG(LWARNING, ("checkAuthorization error", ex.what()));
[Statistics logEvent:@"Editor_Reg_request_result" withParameters:@{kStatIsSuccess : kStatNo,
[Statistics logEvent:@"Editor_Auth_request_result" withParameters:@{kStatIsSuccess : kStatNo,
kStatErrorData : @(ex.what()),
kStatType : self.authTypeAsString}];
}
@ -169,7 +169,7 @@ NSString * getVerifier(NSString * urlString)
if (OsmOAuth::IsValid(ks))
{
osm_auth_ios::AuthorizationStoreCredentials(ks);
[Statistics logEvent:@"Editor_Reg_request_result" withParameters:@{kStatIsSuccess : kStatYes,
[Statistics logEvent:@"Editor_Auth_request_result" withParameters:@{kStatIsSuccess : kStatYes,
kStatType : self.authTypeAsString}];
UIViewController * svc = nil;
for (UIViewController * vc in self.navigationController.viewControllers)

View file

@ -1153,9 +1153,9 @@
"twentyfour_seven" = "ليلا ونهارا";
"day_off_today" = "اليوم عطلة";
"day_off_today" = "مغلق اليوم";
"day_off" = "عطلة";
"day_off" = "مغلق";
"today" = "اليوم";

Some files were not shown because too many files have changed in this diff Show more