Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[core,ios,android] Update feedback URL in code and tests (#13710)
Browse files Browse the repository at this point in the history
* [core,ios] rename all occurrence of www.mapbox.com/map-feedback to apps.mapbox.com/feedback

* [ios,android] rename all occurrence of www.mapbox.com/feedback to apps.mapbox.com/feedback
  • Loading branch information
zugaldia committed Jan 18, 2019
1 parent e0fc92e commit d5659aa
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public class Attribution {
// Using a List makes URL backwards compatible
IMPROVE_MAP_URLS.add("https://www.mapbox.com/feedback/");
IMPROVE_MAP_URLS.add("https://www.mapbox.com/map-feedback/");
IMPROVE_MAP_URLS.add("https://apps.mapbox.com/feedback/");
}

private String title;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
*/
public class AttributionDialogManager implements View.OnClickListener, DialogInterface.OnClickListener {

private static final String MAP_FEEDBACK_URL = "https://www.mapbox.com/feedback";
private static final String MAP_FEEDBACK_URL = "https://apps.mapbox.com/feedback";
private static final String MAP_FEEDBACK_LOCATION_FORMAT = MAP_FEEDBACK_URL + "/#/%f/%f/%d";

@NonNull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
@Config(constants = BuildConfig.class)
public class AttributionParseTest {

private static final String STREETS_ATTRIBUTION = "<a href=\"https://www.mapbox.com/about/maps/\" target=\"_blank\">&copy; Mapbox</a> <a href=\"http://www.openstreetmap.org/about/\" target=\"_blank\">&copy; OpenStreetMap</a> <a class=\"mapbox-improve-map\" href=\"https://www.mapbox.com/map-feedback/\" target=\"_blank\">Improve this map</a>\n";
private static final String SATELLITE_ATTRIBUTION = "<a href=\"https://www.mapbox.com/about/maps/\" target=\"_blank\">&copy; Mapbox</a> <a href=\"http://www.openstreetmap.org/about/\" target=\"_blank\">&copy; OpenStreetMap</a> <a class=\"mapbox-improve-map\" href=\"https://www.mapbox.com/map-feedback/\" target=\"_blank\">Improve this map</a> <a href=\"https://www.digitalglobe.com/\" target=\"_blank\">&copy; DigitalGlobe</a>\n";
private static final String STREETS_ATTRIBUTION = "<a href=\"https://www.mapbox.com/about/maps/\" target=\"_blank\">&copy; Mapbox</a> <a href=\"http://www.openstreetmap.org/about/\" target=\"_blank\">&copy; OpenStreetMap</a> <a class=\"mapbox-improve-map\" href=\"https://apps.mapbox.com/feedback/\" target=\"_blank\">Improve this map</a>\n";
private static final String SATELLITE_ATTRIBUTION = "<a href=\"https://www.mapbox.com/about/maps/\" target=\"_blank\">&copy; Mapbox</a> <a href=\"http://www.openstreetmap.org/about/\" target=\"_blank\">&copy; OpenStreetMap</a> <a class=\"mapbox-improve-map\" href=\"https://apps.mapbox.com/feedback/\" target=\"_blank\">Improve this map</a> <a href=\"https://www.digitalglobe.com/\" target=\"_blank\">&copy; DigitalGlobe</a>\n";

@Test
public void testParseAttributionStringSatellite() throws Exception {
Expand All @@ -39,7 +39,7 @@ public void testParseAttributionStringSatellite() throws Exception {
assertEquals("Title openstreetmap should match", "© OpenStreetMap", attribution.getTitle());
break;
case 2:
assertEquals("URL improve map should match", "https://www.mapbox.com/map-feedback/", attribution.getUrl());
assertEquals("URL improve map should match", "https://apps.mapbox.com/feedback/", attribution.getUrl());
assertEquals("Title improve map should match", "Improve This Map", attribution.getTitle());
break;
case 3:
Expand Down Expand Up @@ -72,7 +72,7 @@ public void testParseAttributionStringStreets() throws Exception {
assertEquals("Title openstreetmap should match", "© OpenStreetMap", attribution.getTitle());
break;
case 2:
assertEquals("URL improve map should match", "https://www.mapbox.com/map-feedback/", attribution.getUrl());
assertEquals("URL improve map should match", "https://apps.mapbox.com/feedback/", attribution.getUrl());
assertEquals("Title improve map should match", "Improve This Map", attribution.getTitle());
break;
}
Expand All @@ -98,7 +98,7 @@ public void testParseAttributionWithoutMapbox() throws Exception {
assertEquals("Title openstreetmap should match", "© OpenStreetMap", attribution.getTitle());
break;
case 1:
assertEquals("URL improve map should match", "https://www.mapbox.com/map-feedback/", attribution.getUrl());
assertEquals("URL improve map should match", "https://apps.mapbox.com/feedback/", attribution.getUrl());
assertEquals("Title improve map should match", "Improve This Map", attribution.getTitle());
break;
}
Expand Down Expand Up @@ -126,7 +126,7 @@ public void testParseAttributionArrayString() throws Exception {
assertEquals("Title openstreetmap should match", "© OpenStreetMap", attribution.getTitle());
break;
case 2:
assertEquals("URL improve map should match", "https://www.mapbox.com/map-feedback/", attribution.getUrl());
assertEquals("URL improve map should match", "https://apps.mapbox.com/feedback/", attribution.getUrl());
assertEquals("Title improve map should match", "Improve This Map", attribution.getTitle());
break;
case 3:
Expand Down Expand Up @@ -188,7 +188,7 @@ public void testParseHideCopyrightAttributionArrayString() throws Exception {
assertEquals("Title openstreetmap should match", "OpenStreetMap", attribution.getTitle());
break;
case 2:
assertEquals("URL improve map should match", "https://www.mapbox.com/map-feedback/", attribution.getUrl());
assertEquals("URL improve map should match", "https://apps.mapbox.com/feedback/", attribution.getUrl());
assertEquals("Title improve map should match", "Improve This Map", attribution.getTitle());
break;
case 3:
Expand Down
2 changes: 1 addition & 1 deletion platform/darwin/src/MGLAttributionInfo.mm
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ - (nullable NSURL *)feedbackURLForStyleURL:(nullable NSURL *)styleURL atCenterCo
return nil;
}

NSURLComponents *components = [NSURLComponents componentsWithString:@"https://www.mapbox.com/feedback/"];
NSURLComponents *components = [NSURLComponents componentsWithString:@"https://apps.mapbox.com/feedback/"];
components.fragment = [NSString stringWithFormat:@"/%.5f/%.5f/%.2f/%.1f/%i",
centerCoordinate.longitude, centerCoordinate.latitude, zoomLevel,
direction, (int)round(pitch)];
Expand Down
8 changes: 4 additions & 4 deletions platform/darwin/test/MGLAttributionInfoTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ - (void)testParsing {
@"<a href=\"https://www.mapbox.com/about/maps/\" target=\"_blank\">&copy; Mapbox</a> "
@"<a href=\"http://www.openstreetmap.org/about/\" target=\"_blank\">©️ OpenStreetMap</a> "
@"CC&nbsp;BY-SA "
@"<a class=\"mapbox-improve-map\" href=\"https://www.mapbox.com/map-feedback/\" target=\"_blank\">Improve this map</a>",
@"<a class=\"mapbox-improve-map\" href=\"https://apps.mapbox.com/feedback/\" target=\"_blank\">Improve this map</a>",
};

NSMutableArray<MGLAttributionInfo *> *infos = [NSMutableArray array];
Expand Down Expand Up @@ -44,13 +44,13 @@ - (void)testParsing {
XCTAssertNil([infos[2] feedbackURLAtCenterCoordinate:mapbox zoomLevel:14]);

XCTAssertEqualObjects(infos[3].title.string, @"Improve this map");
XCTAssertEqualObjects(infos[3].URL, [NSURL URLWithString:@"https://www.mapbox.com/map-feedback/"]);
XCTAssertEqualObjects(infos[3].URL, [NSURL URLWithString:@"https://apps.mapbox.com/feedback/"]);
XCTAssertTrue(infos[3].feedbackLink);
NSURL *styleURL = [MGLStyle satelliteStreetsStyleURLWithVersion:99];
XCTAssertEqualObjects([infos[3] feedbackURLAtCenterCoordinate:mapbox zoomLevel:14],
[NSURL URLWithString:@"https://www.mapbox.com/feedback/?referrer=com.mapbox.Mapbox#/77.63680/12.98108/14.00/0.0/0"]);
[NSURL URLWithString:@"https://apps.mapbox.com/feedback/?referrer=com.mapbox.Mapbox#/77.63680/12.98108/14.00/0.0/0"]);
XCTAssertEqualObjects([infos[3] feedbackURLForStyleURL:styleURL atCenterCoordinate:mapbox zoomLevel:3.14159 direction:90.9 pitch:12.5],
[NSURL URLWithString:@"https://www.mapbox.com/feedback/?referrer=com.mapbox.Mapbox&owner=mapbox&id=satellite-streets-v99&access_token&map_sdk_version=1.0.0#/77.63680/12.98108/3.14/90.9/13"]);
[NSURL URLWithString:@"https://apps.mapbox.com/feedback/?referrer=com.mapbox.Mapbox&owner=mapbox&id=satellite-streets-v99&access_token&map_sdk_version=1.0.0#/77.63680/12.98108/3.14/90.9/13"]);
}

- (void)testStyle {
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test/fixtures/resources/source_raster.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"attribution":"<a href=\"https://www.mapbox.com/about/maps/\" target=\"_blank\">&copy; Mapbox</a> <a href=\"http://www.openstreetmap.org/about/\" target=\"_blank\">&copy; OpenStreetMap</a> <a class=\"mapbox-improve-map\" href=\"https://www.mapbox.com/map-feedback/\" target=\"_blank\">Improve this map</a> <a href=\"https://www.digitalglobe.com/\" target=\"_blank\">&copy; DigitalGlobe</a>","autoscale":true,"bounds":[-180,-85,180,85],"cacheControl":"max-age=43200,s-maxage=604800","center":[0,0,3],"created":1358310600000,"description":"","id":"mapbox.satellite","maxzoom":22,"minzoom":0,"modified":1446150592060,"name":"Mapbox Satellite","private":false,"scheme":"xyz","tilejson":"2.0.0","tiles":["https://a.tiles.mapbox.com/v4/mapbox.satellite/{z}/{x}/{y}.png?access_token=pk.accesstoken","https://b.tiles.mapbox.com/v4/mapbox.satellite/{z}/{x}/{y}.png?access_token=pk.accesstoken"],"webpage":"https://a.tiles.mapbox.com/v4/mapbox.satellite/page.html?access_token=pk.accesstoken"}
{"attribution":"<a href=\"https://www.mapbox.com/about/maps/\" target=\"_blank\">&copy; Mapbox</a> <a href=\"http://www.openstreetmap.org/about/\" target=\"_blank\">&copy; OpenStreetMap</a> <a class=\"mapbox-improve-map\" href=\"https://apps.mapbox.com/feedback/\" target=\"_blank\">Improve this map</a> <a href=\"https://www.digitalglobe.com/\" target=\"_blank\">&copy; DigitalGlobe</a>","autoscale":true,"bounds":[-180,-85,180,85],"cacheControl":"max-age=43200,s-maxage=604800","center":[0,0,3],"created":1358310600000,"description":"","id":"mapbox.satellite","maxzoom":22,"minzoom":0,"modified":1446150592060,"name":"Mapbox Satellite","private":false,"scheme":"xyz","tilejson":"2.0.0","tiles":["https://a.tiles.mapbox.com/v4/mapbox.satellite/{z}/{x}/{y}.png?access_token=pk.accesstoken","https://b.tiles.mapbox.com/v4/mapbox.satellite/{z}/{x}/{y}.png?access_token=pk.accesstoken"],"webpage":"https://a.tiles.mapbox.com/v4/mapbox.satellite/page.html?access_token=pk.accesstoken"}
Loading

0 comments on commit d5659aa

Please sign in to comment.