Skip to content

Commit

Permalink
Added Marker Clustering and moved QuadTree into src
Browse files Browse the repository at this point in the history
  • Loading branch information
mountainvat committed Jul 15, 2016
1 parent cf8fedb commit 5e55e7f
Show file tree
Hide file tree
Showing 94 changed files with 6,497 additions and 50 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ profile
*.moved-aside
DerivedData
.idea/
Pods/
Podfile.lock
10 changes: 10 additions & 0 deletions AUTHORS.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This is the official list of google-maps-ios-utils authors for copyright purposes.
# This file is distinct from the CONTRIBUTORS files.
# See the latter for an explanation.

# Names should be added to this file as:
# Name or Organization <email address>
# The email address is not required for organizations.

Google Inc.

41 changes: 41 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
## Contributing

Want to help out? That's awesome!

The library is open source and lives on GitHub at:
https://github.com/googlemaps/google-maps-ios-utils
Open an issue or fork the library and submit a pull request.

Keep in mind that before we can accept any pull requests we have to jump
through a couple of legal hurdles, primarily a Contributor License Agreement
(CLA):

- **If you are an individual writing original source code**
and you're sure you own the intellectual property,
then you'll need to sign an
[individual CLA](https://developers.google.com/open-source/cla/individual).
- **If you work for a company that wants to allow you to contribute your work**,
then you'll need to sign a
[corporate CLA](https://developers.google.com/open-source/cla/corporate)

Follow either of the two links above to access the appropriate CLA and
instructions for how to sign and return it.

When preparing your code, make sure to update the AUTHORS and CONTRIBUTORS file
to reflect your contribtion.

Once we receive your CLA, we'll be able to review and accept your pull requests.

### Setup
- git clone the repository
- cd to the 'workspace' folder
- run 'pod install'
- open GoogleMapsUtils.xcworkspace
- there should be 2 schemes: GoogleMapsUtils and DevApp

The *GoogleMapsUtils* scheme builds the main source code (currently Marker
Clustering and QuadTree) and has an associated Test action (Project->Test)
which runs the unit tests in the UnitTest target.

The *DevApp* scheme is the test app which builds against the GoogleMapsUtils
target to show the changes in a nice UI app.
5 changes: 0 additions & 5 deletions CONTRIBUTORS.md

This file was deleted.

14 changes: 14 additions & 0 deletions CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# People who have agreed to one of the CLAs and can contribute patches.
# The AUTHORS file lists the copyright holders; this file
# lists people. For example, Google employees are listed here
# but not in AUTHORS, because Google holds the copyright.
#
# https://developers.google.com/open-source/cla/individual
# https://developers.google.com/open-source/cla/corporate
#
# Names should be added to this file as:
# Name <email address>

Son Nguyen <[email protected]>
Brett Morgan <[email protected]>

20 changes: 0 additions & 20 deletions Google-Maps-iOS-Utils-QuadTree.podspec

This file was deleted.

29 changes: 29 additions & 0 deletions Google-Maps-iOS-Utils.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Pod::Spec.new do |s|

s.name = "Google-Maps-iOS-Utils"
s.version = "1.0.0"
s.summary = "A utilities library for use with Google Maps SDK for iOS."
s.description = <<-DESC
This library contains classes that are useful for a wide range of applications
using the Google Maps SDK for iOS.
It is designed to be used with Google Maps SDK for iOS, but it is not
dependent on it.
DESC
s.homepage = "https://github.com/googlemaps/google-maps-ios-utils"
s.license = { :type => 'Apache 2.0', :file => 'LICENSE' }
s.authors = "Google Inc."
s.platform = :ios, '7.0'
s.source = { :git => "https://github.com/googlemaps/google-maps-ios-utils.git",
:tag => s.version }
s.requires_arc = true

s.subspec 'QuadTree' do |sp|
sp.source_files = 'src/QuadTree/**/*.{h,m}'
end

s.subspec 'Clustering' do |sp|
sp.source_files = 'src/Clustering/**/*.{h,m}'
sp.dependency 'Google-Maps-iOS-Utils/QuadTree'
end

end
9 changes: 0 additions & 9 deletions QuadTree/GQTBounds.h

This file was deleted.

4 changes: 0 additions & 4 deletions QuadTree/GQTPoint.h

This file was deleted.

8 changes: 0 additions & 8 deletions QuadTree/GQTPointQuadTreeItem.h

This file was deleted.

17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,21 @@ google-maps-ios-utils
=====================

This open-source library contains classes that are useful for a wide
range of applications using the [Google Maps SDK for iOS][sdk]. ![Analytics](https://maps-ga-beacon.appspot.com/UA-12846745-20/google-maps-ios-utils/readme?pixel)
range of applications using the [Google Maps SDK for iOS][sdk].

- **Marker clustering** — handles the display of a large number of points
- **Quadtree data structure** - indexes 2D geometry points and performs
2D range queries

The library is under development, but ready for use. Check the
[issue tracker][issues] to see what's happening.
<p align="center"><img width="90%" vspace="20" src="https://cloud.githubusercontent.com/assets/16808355/16646253/77feeb96-446c-11e6-9ec1-19e12a7fb3ae.png"></p>


[sdk]: https://developers.google.com/maps/documentation/ios/
For more information, check out the detailed guide on the
[Google Developers site][devsite-guide].

To contribute to the library, see [Contributing][contributing].

[contributing]: CONTRIBUTING.md
[devsite-guide]: https://developers.google.com/maps/documentation/ios-sdk/utility/
[sdk]: https://developers.google.com/maps/documentation/ios-sdk
[issues]: https://github.com/googlemaps/google-maps-ios-utils/issues
22 changes: 22 additions & 0 deletions app/AppDelegate.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* Copyright (c) 2016 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#import <UIKit/UIKit.h>

@interface AppDelegate : UIResponder<UIApplicationDelegate>

@property(strong, nonatomic) UIWindow *window;

@end
45 changes: 45 additions & 0 deletions app/AppDelegate.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/* Copyright (c) 2016 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif

#import "AppDelegate.h"
#import "ViewController.h"

#import <GoogleMaps/GoogleMaps.h>

#error Change this key to a valid key registered with the demo app bundle id. Then delete this line.
static NSString *const kMapsAPIKey = @"";

@interface AppDelegate ()
@end

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[GMSServices provideAPIKey:kMapsAPIKey];

UIViewController *rootViewController = [[ViewController alloc] init];
UINavigationController *navigationController =
[[UINavigationController alloc] initWithRootViewController:rootViewController];
navigationController.navigationBar.translucent = NO;
self.window.rootViewController = navigationController;
return YES;
}

@end
27 changes: 27 additions & 0 deletions app/Base.lproj/LaunchScreen.storyboard
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9532" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9530"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
</document>
26 changes: 26 additions & 0 deletions app/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9532" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9530"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="ViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
</document>
47 changes: 47 additions & 0 deletions app/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
29 changes: 29 additions & 0 deletions app/POIItem.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/* Copyright (c) 2016 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/


#import <Foundation/Foundation.h>

#import "GMUClusterItem.h"

// Point of Interest Item which implements the GMUClusterItem protocol.
@interface POIItem : NSObject<GMUClusterItem>

@property(nonatomic, readonly) CLLocationCoordinate2D position;
@property(nonatomic, readonly) NSString *name;

- (instancetype)initWithPosition:(CLLocationCoordinate2D)position name:(NSString *)name;

@end
Loading

0 comments on commit 5e55e7f

Please sign in to comment.