Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jineshfrancs/ThemedGoogleMap
Utility class to make GoogleMap with custom theme.
https://github.com/jineshfrancs/ThemedGoogleMap
custom-theme googlemaps
Last synced: 2 months ago
JSON representation
Utility class to make GoogleMap with custom theme.
- Host: GitHub
- URL: https://github.com/jineshfrancs/ThemedGoogleMap
- Owner: jineshfrancs
- License: apache-2.0
- Created: 2016-12-21T04:33:39.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2023-02-01T11:37:26.000Z (almost 2 years ago)
- Last Synced: 2024-08-02T01:25:20.485Z (6 months ago)
- Topics: custom-theme, googlemaps
- Language: Java
- Size: 827 KB
- Stars: 169
- Watchers: 8
- Forks: 28
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-github-android-ui - ThemedGoogleMap - 创建带自定义主题的GoogleMap的实用类 (地图)
README
# ThemedGoogleMap
Utility class to make GoogleMap with custom theme.
Create your own theme like this
```java
GoogleMapStyler googleMapStyler = new GoogleMapStyler.Builder(MainActivity.this)
.setMainGeometryColorRes(R.color.maingeometrycolor)
.setAllPlaceTextStrokeAlpha(-80)
.setAllPlaceTextColorRes(R.color.adminstartivelabel)
.setAllMainTownTextColorRes(R.color.administativelocality)
.setAllPoiTextColorRes(R.color.poitext)
.setAllPoiParkBackgroundColorRes(R.color.poiparkbackground)
.setAllPoiParkTextColorRes(R.color.poilabel)
.setAllRoadBackgroundColorRes(R.color.roadbackground)
.setAllRoadTextColorRes(R.color.roadlabel)
.setAllRoadArterialBackgroundColorRes(R.color.roadarterialbackground)
.setAllRoadArterialStrokeColorRes(R.color.roadarterialstroke)
.setAllRoadHighwayBackgroundColorRes(R.color.roadhighway)
.setAllRoadHighwayStrokeColorRes(R.color.roadhighwaystroke)
.setAllRoadHighwayTextColorRes(R.color.roadhighwaylabel)
.setAllRoadLocalBackgroundColorRes(R.color.roadlocal)
.setAllRoadLocalStrokeColorRes(R.color.roadlocalstroke)
.setAllTransitStationTextColorRes(R.color.transitstationtext)
.setAllTransitBackgroundColorRes(R.color.transit)
.setAllWaterTextColorRes(R.color.waterlabel)
.setAllWaterBackgroundColorRes(R.color.water)
.setAllWaterTextStrokeAlpha(-20)
.build();// Alternatively to use a Color int, remove the Res from the method name
// Example:
// setMainGeometryColor(Color.BLACK)
```
Apply generated style to google map```java
googleMap.setMapStyle(googleMapStyler.getMapStyleOptions());
```
Use in your project
------1.Add it in your root build.gradle at the end of repositories:
```gradle
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
```2.Add the dependency in your app build.gradle file:
```gradle
dependencies {
compile 'com.github.jineshfrancs:ThemedGoogleMap:1.0'
}
```