Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace mapbox watermark on the maps with maplibre #643 and replace mapbox resource names #647

Merged
merged 9 commits into from
Jan 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions platform/android/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ MapLibre welcomes participation and contributions from everyone. Please read [`C
### ✨ Features and improvements

* Add your pull request...
* Breaking: Changed resourcePrefix to `maplibre_` from `mapbox_` [647](https://github.com/maplibre/maplibre-gl-native/pull/647) and renamed resources accordingly. Note that this is a breaking change since the names of public resources were renamed as well. Replaced Mapbox logo with MapLibre logo.
* GMS location: Replace new LocationRequest() with LocationRequest.Builder, and LocationRequest.PRIORITY_X with Priority.PRIORITY_X ([620](https://github.com/maplibre/maplibre-gl-native/pull/620))

### 🐞 Bug fixes
Expand Down
2 changes: 1 addition & 1 deletion platform/android/MapboxGLAndroidSDK/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ android {
nativeBuild(nativeTargets)

// avoid naming conflicts, force usage of prefix
resourcePrefix 'mapbox_'
resourcePrefix 'maplibre_'

sourceSets {
// limit amount of exposed library resources
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,22 +67,22 @@ public BubbleLayout(@NonNull Context context, AttributeSet attrs) {
public BubbleLayout(@NonNull Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);

TypedArray a = getContext().obtainStyledAttributes(attrs, R.styleable.mapbox_BubbleLayout);
TypedArray a = getContext().obtainStyledAttributes(attrs, R.styleable.maplibre_BubbleLayout);
@ArrowDirection.Value
int location = a.getInt(R.styleable.mapbox_BubbleLayout_mapbox_bl_arrowDirection,
int location = a.getInt(R.styleable.maplibre_BubbleLayout_maplibre_bl_arrowDirection,
ArrowDirection.LEFT);
arrowDirection = new ArrowDirection(location);
arrowWidth = a.getDimension(R.styleable.mapbox_BubbleLayout_mapbox_bl_arrowWidth,
arrowWidth = a.getDimension(R.styleable.maplibre_BubbleLayout_maplibre_bl_arrowWidth,
convertDpToPixel(8, context));
arrowHeight = a.getDimension(R.styleable.mapbox_BubbleLayout_mapbox_bl_arrowHeight,
arrowHeight = a.getDimension(R.styleable.maplibre_BubbleLayout_maplibre_bl_arrowHeight,
convertDpToPixel(8, context));
arrowPosition = a.getDimension(R.styleable.mapbox_BubbleLayout_mapbox_bl_arrowPosition,
arrowPosition = a.getDimension(R.styleable.maplibre_BubbleLayout_maplibre_bl_arrowPosition,
convertDpToPixel(12, context));
cornersRadius = a.getDimension(R.styleable.mapbox_BubbleLayout_mapbox_bl_cornersRadius, 0);
bubbleColor = a.getColor(R.styleable.mapbox_BubbleLayout_mapbox_bl_bubbleColor, Color.WHITE);
cornersRadius = a.getDimension(R.styleable.maplibre_BubbleLayout_maplibre_bl_cornersRadius, 0);
bubbleColor = a.getColor(R.styleable.maplibre_BubbleLayout_maplibre_bl_bubbleColor, Color.WHITE);
strokeWidth =
a.getDimension(R.styleable.mapbox_BubbleLayout_mapbox_bl_strokeWidth, DEFAULT_STROKE_WIDTH);
strokeColor = a.getColor(R.styleable.mapbox_BubbleLayout_mapbox_bl_strokeColor, Color.GRAY);
a.getDimension(R.styleable.maplibre_BubbleLayout_maplibre_bl_strokeWidth, DEFAULT_STROKE_WIDTH);
strokeColor = a.getColor(R.styleable.maplibre_BubbleLayout_maplibre_bl_strokeColor, Color.GRAY);

a.recycle();
initPadding();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ static PopupWindow create(@NonNull Context context, @NonNull BubbleLayout bubble
// change background color to transparent
Drawable drawable;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
drawable = context.getDrawable(R.drawable.mapbox_popup_window_transparent);
drawable = context.getDrawable(R.drawable.maplibre_popup_window_transparent);
} else {
drawable = context.getResources().getDrawable(R.drawable.mapbox_popup_window_transparent);
drawable = context.getResources().getDrawable(R.drawable.maplibre_popup_window_transparent);
}
popupWindow.setBackgroundDrawable(drawable);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public Icon fromResource(@DrawableRes int resourceId) {
*/
public Icon defaultMarker() {
if (defaultMarker == null) {
defaultMarker = fromResource(R.drawable.mapbox_marker_icon_default);
defaultMarker = fromResource(R.drawable.maplibre_marker_icon_default);
}
return defaultMarker;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ InfoWindow open(@NonNull MapView mapView, Marker boundMarker, @NonNull LatLng po
final float mapRight = mapView.getRight();
final float mapLeft = mapView.getLeft();

float marginHorizontal = resources.getDimension(R.dimen.mapbox_infowindow_margin);
float tipViewOffset = resources.getDimension(R.dimen.mapbox_infowindow_tipview_width) / 2;
float marginHorizontal = resources.getDimension(R.dimen.maplibre_infowindow_margin);
float tipViewOffset = resources.getDimension(R.dimen.maplibre_infowindow_tipview_width) / 2;
float tipViewMarginLeft = view.getMeasuredWidth() / 2 - tipViewOffset;

boolean outOfBoundsLeft = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ private InfoWindow showInfoWindow(InfoWindow iw, MapView mapView) {
@Nullable
private InfoWindow getInfoWindow(@NonNull MapView mapView) {
if (infoWindow == null && mapView.getContext() != null) {
infoWindow = new InfoWindow(mapView, R.layout.mapbox_infowindow_content, getMapboxMap());
infoWindow = new InfoWindow(mapView, R.layout.maplibre_infowindow_content, getMapboxMap());
}
return infoWindow;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,12 +223,12 @@ class CameraPosition
*/
constructor(typedArray: TypedArray?) : super() {
if (typedArray != null) {
bearing = typedArray.getFloat(R.styleable.mapbox_MapView_mapbox_cameraBearing, 0.0f).toDouble()
val lat = typedArray.getFloat(R.styleable.mapbox_MapView_mapbox_cameraTargetLat, 0.0f).toDouble()
val lng = typedArray.getFloat(R.styleable.mapbox_MapView_mapbox_cameraTargetLng, 0.0f).toDouble()
bearing = typedArray.getFloat(R.styleable.maplibre_MapView_maplibre_cameraBearing, 0.0f).toDouble()
val lat = typedArray.getFloat(R.styleable.maplibre_MapView_maplibre_cameraTargetLat, 0.0f).toDouble()
val lng = typedArray.getFloat(R.styleable.maplibre_MapView_maplibre_cameraTargetLng, 0.0f).toDouble()
target = LatLng(lat, lng)
tilt = typedArray.getFloat(R.styleable.mapbox_MapView_mapbox_cameraTilt, 0.0f).toDouble()
zoom = typedArray.getFloat(R.styleable.mapbox_MapView_mapbox_cameraZoom, 0.0f).toDouble()
tilt = typedArray.getFloat(R.styleable.maplibre_MapView_maplibre_cameraTilt, 0.0f).toDouble()
zoom = typedArray.getFloat(R.styleable.maplibre_MapView_maplibre_cameraZoom, 0.0f).toDouble()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Bitmap generateBitmap(@DrawableRes int drawableRes, @ColorInt Integer tintColor)
}

Bitmap generateShadowBitmap(@NonNull LocationComponentOptions options) {
Drawable shadowDrawable = BitmapUtils.getDrawableFromRes(context, R.drawable.mapbox_user_icon_shadow);
Drawable shadowDrawable = BitmapUtils.getDrawableFromRes(context, R.drawable.maplibre_user_icon_shadow);
return generateShadow(shadowDrawable, options.elevation());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ public LocationComponent(@NonNull MapboxMap mapboxMap,
@Deprecated
public void activateLocationComponent(@NonNull Context context, @NonNull Style style) {
activateLocationComponent(context, style,
LocationComponentOptions.createFromAttributes(context, R.style.mapbox_LocationComponent));
LocationComponentOptions.createFromAttributes(context, R.style.maplibre_LocationComponent));
}

/**
Expand All @@ -265,9 +265,9 @@ public void activateLocationComponent(@NonNull Context context, @NonNull Style s
public void activateLocationComponent(@NonNull Context context, @NonNull Style style,
boolean useDefaultLocationEngine) {
if (useDefaultLocationEngine) {
activateLocationComponent(context, style, R.style.mapbox_LocationComponent);
activateLocationComponent(context, style, R.style.maplibre_LocationComponent);
} else {
activateLocationComponent(context, style, null, R.style.mapbox_LocationComponent);
activateLocationComponent(context, style, null, R.style.maplibre_LocationComponent);
}
}

Expand All @@ -288,9 +288,9 @@ public void activateLocationComponent(@NonNull Context context, @NonNull Style s
@NonNull LocationEngineRequest locationEngineRequest) {
setLocationEngineRequest(locationEngineRequest);
if (useDefaultLocationEngine) {
activateLocationComponent(context, style, R.style.mapbox_LocationComponent);
activateLocationComponent(context, style, R.style.maplibre_LocationComponent);
} else {
activateLocationComponent(context, style, null, R.style.mapbox_LocationComponent);
activateLocationComponent(context, style, null, R.style.maplibre_LocationComponent);
}
}

Expand Down Expand Up @@ -402,7 +402,7 @@ public void activateLocationComponent(@NonNull Context context, @NonNull Style s
@Deprecated
public void activateLocationComponent(@NonNull Context context, @NonNull Style style,
@Nullable LocationEngine locationEngine) {
activateLocationComponent(context, style, locationEngine, R.style.mapbox_LocationComponent);
activateLocationComponent(context, style, locationEngine, R.style.maplibre_LocationComponent);
}

/**
Expand All @@ -418,7 +418,12 @@ public void activateLocationComponent(@NonNull Context context, @NonNull Style s
public void activateLocationComponent(@NonNull Context context, @NonNull Style style,
@Nullable LocationEngine locationEngine,
@NonNull LocationEngineRequest locationEngineRequest) {
activateLocationComponent(context, style, locationEngine, locationEngineRequest, R.style.mapbox_LocationComponent);
activateLocationComponent(
context,
style,
locationEngine,
locationEngineRequest,
R.style.maplibre_LocationComponent);
}

/**
Expand Down Expand Up @@ -472,7 +477,7 @@ public void activateLocationComponent(@NonNull LocationComponentActivationOption
if (options == null) {
int styleRes = activationOptions.styleRes();
if (styleRes == 0) {
styleRes = R.style.mapbox_LocationComponent;
styleRes = R.style.maplibre_LocationComponent;
}
options = LocationComponentOptions.createFromAttributes(activationOptions.context(), styleRes);
}
Expand Down
Loading