[core,ios,android] Update feedback URL in code and tests (#13710)
* [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
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -37,7 +37,7 @@ import java.util.Set;
|
||||
*/
|
||||
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
|
||||
|
||||
@@ -15,8 +15,8 @@ import static junit.framework.Assert.assertEquals;
|
||||
@Config(constants = BuildConfig.class)
|
||||
public class AttributionParseTest {
|
||||
|
||||
private static final String STREETS_ATTRIBUTION = "<a href=\"https://www.mapbox.com/about/maps/\" target=\"_blank\">© Mapbox</a> <a href=\"http://www.openstreetmap.org/about/\" target=\"_blank\">© 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\">© Mapbox</a> <a href=\"http://www.openstreetmap.org/about/\" target=\"_blank\">© 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\">© DigitalGlobe</a>\n";
|
||||
private static final String STREETS_ATTRIBUTION = "<a href=\"https://www.mapbox.com/about/maps/\" target=\"_blank\">© Mapbox</a> <a href=\"http://www.openstreetmap.org/about/\" target=\"_blank\">© 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\">© Mapbox</a> <a href=\"http://www.openstreetmap.org/about/\" target=\"_blank\">© 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\">© DigitalGlobe</a>\n";
|
||||
|
||||
@Test
|
||||
public void testParseAttributionStringSatellite() throws Exception {
|
||||
@@ -39,7 +39,7 @@ public class AttributionParseTest {
|
||||
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:
|
||||
@@ -72,7 +72,7 @@ public class AttributionParseTest {
|
||||
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;
|
||||
}
|
||||
@@ -98,7 +98,7 @@ public class AttributionParseTest {
|
||||
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;
|
||||
}
|
||||
@@ -126,7 +126,7 @@ public class AttributionParseTest {
|
||||
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:
|
||||
@@ -188,7 +188,7 @@ public class AttributionParseTest {
|
||||
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:
|
||||
|
||||
@@ -161,7 +161,7 @@
|
||||
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)];
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
@"<a href=\"https://www.mapbox.com/about/maps/\" target=\"_blank\">© Mapbox</a> "
|
||||
@"<a href=\"http://www.openstreetmap.org/about/\" target=\"_blank\">©️ OpenStreetMap</a> "
|
||||
@"CC 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];
|
||||
@@ -44,13 +44,13 @@
|
||||
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 {
|
||||
|
||||
File diff suppressed because one or more lines are too long
2
test/fixtures/resources/source_raster.json
vendored
2
test/fixtures/resources/source_raster.json
vendored
@@ -1 +1 @@
|
||||
{"attribution":"<a href=\"https://www.mapbox.com/about/maps/\" target=\"_blank\">© Mapbox</a> <a href=\"http://www.openstreetmap.org/about/\" target=\"_blank\">© 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\">© 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\">© Mapbox</a> <a href=\"http://www.openstreetmap.org/about/\" target=\"_blank\">© 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\">© 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"}
|
||||
2
test/fixtures/resources/source_vector.json
vendored
2
test/fixtures/resources/source_vector.json
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user