Skip to content

Commit

Permalink
refactoring to add scheme check
Browse files Browse the repository at this point in the history
  • Loading branch information
Langston Smith committed Jan 10, 2018
1 parent 6a206f4 commit 08d5ef3
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
public final class LocalizationPlugin {

private MapboxMap mapboxMap;
private String TAG = "LocalizationPlugin";

/**
* Create a {@link LocalizationPlugin}.
Expand Down Expand Up @@ -105,14 +106,16 @@ public void setMapTextLanguage(String languageToSetMapTo) {
*/
private boolean sourceIsFromMapbox(Source singleSource) {
return singleSource instanceof VectorSource
&& ((VectorSource) singleSource).getUrl().contains("mapbox://mapbox.mapbox");
&& ((VectorSource) singleSource).getUrl().substring(0, 9).equals("mapbox://")
&& (((VectorSource) singleSource).getUrl().contains("mapbox.mapbox-streets-v7")
|| ((VectorSource) singleSource).getUrl().contains("mapbox.mapbox-streets-v6"));
}

/**
* Checks whether a single map layer has a textField that could potentially be localized to the device's language.
*
* @param singleLayer an individual layer from the map
* @return true if the layer has a textField elegible for translation, false if not.
* @return true if the layer has a textField eligible for translation, false if not.
*/

private boolean layerHasAdjustableTextField(Layer singleLayer) {
Expand Down

0 comments on commit 08d5ef3

Please sign in to comment.