Skip to content
This repository has been archived by the owner on Jun 14, 2024. It is now read-only.

Example for MGLImageSource #120

Merged
merged 8 commits into from
Nov 8, 2017
Merged

Example for MGLImageSource #120

merged 8 commits into from
Nov 8, 2017

Conversation

jmkiley
Copy link
Contributor

@jmkiley jmkiley commented Oct 27, 2017

Addresses #93 and adds example for MGLImageSource.

  • Add comments.

@@ -802,7 +810,7 @@
0503373D1F7199DF007309B0 = {
CreatedOnToolsVersion = 8.3.3;
DevelopmentTeam = GJZR2MEM28;
LastSwiftMigration = 0900;
LastSwiftMigration = 0910;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let’s stick to using the latest stable version of Xcode.

Podfile Outdated
installer.pods_project.targets.each do |target|
if target.name == 'DocsCode'
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3.0'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The DocsCode targets should use the same Swift version as the rest of the project → #123.

topRight: CLLocationCoordinate2D(latitude: 46.437, longitude: -71.516))

// Create a MGLImageSource that uses
let source = MGLImageSource(identifier: "radar", coordinateQuad: coordinates, url: URL(string: "https://www.mapbox.com/mapbox-gl-js/assets/radar.gif")!)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using a remote URL is 👌, but let’s use our own copies of resources.

- (void)viewDidLoad {
[super viewDidLoad];

MGLMapView *mapView = [[MGLMapView alloc] initWithFrame:self.view.bounds styleURL: [MGLStyle darkStyleURL]];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: there’s an unnecessary space after styleURL:.

}

- (void)mapView:(MGLMapView *)mapView didFinishLoadingStyle:(MGLStyle *)style {
MGLCoordinateQuad coordinates = MGLCoordinateQuadMake(CLLocationCoordinate2DMake(46.437, -80.425), CLLocationCoordinate2DMake(37.936, -80.425), CLLocationCoordinate2DMake(37.936, -71.516), CLLocationCoordinate2DMake(46.437, -71.516));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hrm, does this wrap well? Might consider doing what you did in the Swift version and manually wrap.

@jmkiley jmkiley removed the WIP label Nov 3, 2017
@jmkiley jmkiley changed the title [WIP] Example for MGLImageSource Example for MGLImageSource Nov 3, 2017
Copy link
Contributor

@captainbarbosa captainbarbosa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 with a few comments

[super viewDidLoad];

MGLMapView *mapView = [[MGLMapView alloc] initWithFrame:self.view.bounds styleURL:[MGLStyle darkStyleURL]];
mapView.delegate = self;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a comment above that matches our other examples?

CLLocationCoordinate2DMake(37.936, -71.516),
CLLocationCoordinate2DMake(46.437, -71.516));

// Create a MGLImageSource, which can be used to add georeferenced raster images the style of a map.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add georeferenced raster images the style of a map.
👇
add georeferenced raster images to a map.

super.viewDidLoad()

let mapView = MGLMapView(frame: view.bounds, styleURL: MGLStyle.darkStyleURL())
mapView.delegate = self
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as in the Objective-C example.

bottomRight: CLLocationCoordinate2D(latitude: 37.936, longitude: -71.516),
topRight: CLLocationCoordinate2D(latitude: 46.437, longitude: -71.516))

// Create a MGLImageSource, which can be used to add georeferenced raster images the style of a map.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add georeferenced raster images the style of a map.
👇
add georeferenced raster images to a map.

@jmkiley jmkiley merged commit fab3ee8 into ios-v3.7.0 Nov 8, 2017
@jmkiley jmkiley deleted the jk-image-source branch November 8, 2017 21:27
jmkiley added a commit that referenced this pull request Nov 8, 2017
* bumped podfile

* added objective-c

* Added some comments

* Improved comments

* Moved example within list

* Edited Podfile

* addressed @captainbarbosa's feedback
jmkiley added a commit that referenced this pull request Nov 13, 2017
* bumped podfile

* added objective-c

* Added some comments

* Improved comments

* Moved example within list

* Edited Podfile

* addressed @captainbarbosa's feedback
friedbunny pushed a commit that referenced this pull request Nov 17, 2017
* bumped podfile

* added objective-c

* Added some comments

* Improved comments

* Moved example within list

* Edited Podfile

* addressed @captainbarbosa's feedback

Fix rebase/merge mistakes.

Added resizing for map view
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants