Skip to content

Commit

Permalink
Change module id, update example, bump 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hansemannn committed Nov 22, 2015
1 parent 8bec5ea commit 9fd7a0c
Show file tree
Hide file tree
Showing 25 changed files with 152 additions and 156 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,25 @@ Download + Setup

### Download
* [Stable release](https://github.com/hansemannn/Ti.GoogleMaps/releases)
* Install from gitTio [![gitTio](http://gitt.io/badge.png)](http://gitt.io/component/de.hansknoechel.googlemaps)
* Install from gitTio [![gitTio](http://gitt.io/badge.png)](http://gitt.io/component/ti.googlemaps)

### Setup
Unpack the module and place it inside the ``/modules/iphone`` folder of your project.
Edit the modules section of your ``tiapp.xml`` file to include this module:
```xml
<modules>
<module platform="iphone">de.hansknoechel.googlemaps</module>
<module platform="iphone">ti.googlemaps</module>
</modules>
```

> **NOTE:** For now, you need to copy the ``GoogleMaps.bundle`` from ``<PROJECT_ROOT>/modules/de.hansknoechel.googlemaps/<VERSION>/platform``
> **NOTE:** The module id changed from ``de.hansknoechel.googlemaps`` to ``ti.googlemaps`` in 2.0.0 to make it easier to include the module.
> **NOTE:** For now, you need to copy the ``GoogleMaps.bundle`` from ``<PROJECT_ROOT>/modules/ti.googlemaps/<VERSION>/platform``
to ``<PROJECT_ROOT>/platform/iphone`` to make the module run. This only needs to be done the first time you install the module.
We are working to get this done automatically.

Initialize the module by setting the Google Maps API key you can get from [here](https://developers.google.com/maps/signup).
```javascriipt
```javascript
var maps = require("de.hansknoechel.googlemaps");
maps.setAPIKey("<YOUR_API_KEY>");
```
Expand Down
4 changes: 2 additions & 2 deletions example/app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var win = Ti.UI.createWindow();
var maps = require("de.hansknoechel.googlemaps");
maps.setAPIKey("AIzaSyD3aXswuFfGmyfFEpuoBn2pFu4UY0TKdgc");
var maps = require("tigooglemaps");
maps.setAPIKey("<YOUR_GOOGLE_MAPS_API_KEY>");

/*
* Test data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#import <GoogleMaps/GoogleMaps.h>
#import "TiUtils.h"

@interface DeHansknoechelGooglemapsCircleProxy : TiProxy
@interface TiGooglemapsCircleProxy : TiProxy

@property(nonatomic,retain) GMSCircle *circle;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* Please see the LICENSE included with this distribution for details.
*/

#import "DeHansknoechelGooglemapsCircleProxy.h"
#import "TiGooglemapsCircleProxy.h"

@implementation DeHansknoechelGooglemapsCircleProxy
@implementation TiGooglemapsCircleProxy

@synthesize circle = _circle, path = _path;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
*/
#import "TiUIView.h"
#import <GoogleMaps/GoogleMaps.h>
#import "DeHansknoechelGooglemapsMarkerProxy.h"
#import "TiGooglemapsMapView.h"

@interface DeHansknoechelGooglemapsMapView : TiUIView<GMSMapViewDelegate>
@interface TiGooglemapsMapView : TiUIView<GMSMapViewDelegate>

@property(nonatomic,retain) GMSMapView *mapView;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
* Please see the LICENSE included with this distribution for details.
*/

#import "DeHansknoechelGooglemapsMapView.h"
#import "DeHansknoechelGooglemapsMarkerProxy.h"
#import "DeHansknoechelGooglemapsMapViewProxy.h"
#import "TiGooglemapsMapView.h"
#import "TiGooglemapsMarkerProxy.h"
#import "TiGooglemapsMapViewProxy.h"

@implementation DeHansknoechelGooglemapsMapView
@implementation TiGooglemapsMapView

@synthesize mapView = _mapView;

Expand Down Expand Up @@ -195,7 +195,7 @@ - (void)mapView:(GMSMapView *)mapView didDragMarker:(GMSMarker *)marker
- (BOOL)didTapMyLocationButtonForMapView:(GMSMapView *)mapView
{
if ([[self proxy] _hasListeners:@"locationclick"]) {
DeHansknoechelGooglemapsMapViewProxy *mapViewProxy = [[DeHansknoechelGooglemapsMapViewProxy alloc] init];
TiGooglemapsMapViewProxy *mapViewProxy = [[TiGooglemapsMapViewProxy alloc] init];
[mapViewProxy setMapView:mapView];

NSDictionary *event = @{
Expand Down Expand Up @@ -236,7 +236,7 @@ -(NSDictionary*)dictionaryFromOverlay:(GMSOverlay*)overlay
return @{};
}

DeHansknoechelGooglemapsMapViewProxy *mapViewProxy = [[DeHansknoechelGooglemapsMapViewProxy alloc] init];
TiGooglemapsMapViewProxy *mapViewProxy = [[TiGooglemapsMapViewProxy alloc] init];
[mapViewProxy setMapView:[overlay map]];

return @{
Expand All @@ -247,13 +247,13 @@ -(NSDictionary*)dictionaryFromOverlay:(GMSOverlay*)overlay
};
}

-(DeHansknoechelGooglemapsMarkerProxy*)markerProxyFromMarker:(GMSMarker*)marker
-(TiGooglemapsMarkerProxy*)markerProxyFromMarker:(GMSMarker*)marker
{
if (marker == nil) {
return nil;
}

DeHansknoechelGooglemapsMarkerProxy* markerProxy = [[DeHansknoechelGooglemapsMarkerProxy alloc] init];
TiGooglemapsMarkerProxy* markerProxy = [[TiGooglemapsMarkerProxy alloc] init];
[markerProxy setMarker:marker];

return markerProxy;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
* Please see the LICENSE included with this distribution for details.
*/
#import "TiViewProxy.h"
#import "DeHansknoechelGooglemapsMapView.h"
#import "TiGooglemapsMapView.h"

@interface DeHansknoechelGooglemapsMapViewProxy : TiViewProxy<GMSMapViewDelegate> {
DeHansknoechelGooglemapsMapView* mapView;
@interface TiGooglemapsMapViewProxy : TiViewProxy<GMSMapViewDelegate> {
TiGooglemapsMapViewProxy* mapView;
}

-(void)setMapView:(GMSMapView*)mapView;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
* Please see the LICENSE included with this distribution for details.
*/

#import "DeHansknoechelGooglemapsMapViewProxy.h"
#import "DeHansknoechelGooglemapsMarkerProxy.h"
#import "DeHansknoechelGooglemapsPolylineProxy.h"
#import "DeHansknoechelGooglemapsPolygonProxy.h"
#import "DeHansknoechelGooglemapsCircleProxy.h"
#import "TiGooglemapsMapViewProxy.h"
#import "TiGooglemapsMarkerProxy.h"
#import "TiGooglemapsPolylineProxy.h"
#import "TiGooglemapsPolygonProxy.h"
#import "TiGooglemapsCircleProxy.h"
#import "TiUtils.h"

@implementation DeHansknoechelGooglemapsMapViewProxy
@implementation TiGooglemapsMapViewProxy

-(DeHansknoechelGooglemapsMapView*)mapView
-(TiGooglemapsMapView*)mapView
{
return (DeHansknoechelGooglemapsMapView*)[self view];
return (TiGooglemapsMapView*)[self view];
}

-(void)setMapView:(GMSMapView*)_mapView
Expand All @@ -28,9 +28,9 @@ -(void)setMapView:(GMSMapView*)_mapView

-(void)addMarker:(id)args
{
DeHansknoechelGooglemapsMarkerProxy *marker = [args objectAtIndex:0];
TiGooglemapsMarkerProxy *marker = [args objectAtIndex:0];

ENSURE_TYPE(marker, DeHansknoechelGooglemapsMarkerProxy);
ENSURE_TYPE(marker, TiGooglemapsMarkerProxy);
ENSURE_UI_THREAD_1_ARG(args);

[[marker marker] setMap:[[self mapView] mapView]];
Expand All @@ -43,16 +43,16 @@ -(void)addMarkers:(id)args
ENSURE_TYPE(markers, NSArray);
ENSURE_UI_THREAD_1_ARG(args);

for(DeHansknoechelGooglemapsMarkerProxy *marker in markers) {
for(TiGooglemapsMarkerProxy *marker in markers) {
[[marker marker] setMap:[[self mapView] mapView]];
}
}

-(void)removeMarker:(id)args
{
DeHansknoechelGooglemapsMarkerProxy *marker = [args objectAtIndex:0];
TiGooglemapsMarkerProxy *marker = [args objectAtIndex:0];

ENSURE_TYPE(marker, DeHansknoechelGooglemapsMarkerProxy);
ENSURE_TYPE(marker, TiGooglemapsMarkerProxy);
ENSURE_UI_THREAD_1_ARG(args);

[[marker marker] setMap:nil];
Expand All @@ -63,7 +63,7 @@ -(void)addPolyline:(id)args
id polyline = [args objectAtIndex:0];

ENSURE_UI_THREAD_1_ARG(args);
ENSURE_TYPE(polyline, DeHansknoechelGooglemapsPolylineProxy);
ENSURE_TYPE(polyline, TiGooglemapsPolylineProxy);

[[polyline polyline] setMap:[[self mapView] mapView]];
}
Expand All @@ -73,7 +73,7 @@ -(void)removePolyline:(id)args
id polyline = [args objectAtIndex:0];

ENSURE_UI_THREAD_1_ARG(args);
ENSURE_TYPE(polyline, DeHansknoechelGooglemapsPolylineProxy);
ENSURE_TYPE(polyline, TiGooglemapsPolylineProxy);

[[polyline polyline] setMap:nil];
}
Expand All @@ -83,7 +83,7 @@ -(void)addPolygon:(id)args
id polygon = [args objectAtIndex:0];

ENSURE_UI_THREAD_1_ARG(args);
ENSURE_TYPE(polygon, DeHansknoechelGooglemapsPolygonProxy);
ENSURE_TYPE(polygon, TiGooglemapsPolygonProxy);

[[polygon polygon] setMap:[[self mapView] mapView]];
}
Expand All @@ -93,7 +93,7 @@ -(void)removePolygon:(id)args
id polygon = [args objectAtIndex:0];

ENSURE_UI_THREAD_1_ARG(args);
ENSURE_TYPE(polygon, DeHansknoechelGooglemapsPolygonProxy);
ENSURE_TYPE(polygon, TiGooglemapsPolygonProxy);

[[polygon polygon] setMap:nil];
}
Expand All @@ -103,7 +103,7 @@ -(void)addCircle:(id)args
id circle = [args objectAtIndex:0];

ENSURE_UI_THREAD_1_ARG(args);
ENSURE_TYPE(circle, DeHansknoechelGooglemapsCircleProxy);
ENSURE_TYPE(circle, TiGooglemapsCircleProxy);

[[circle circle] setMap:[[self mapView] mapView]];
}
Expand All @@ -113,7 +113,7 @@ -(void)removeCircle:(id)args
id circle = [args objectAtIndex:0];

ENSURE_UI_THREAD_1_ARG(args);
ENSURE_TYPE(circle, DeHansknoechelGooglemapsCircleProxy);
ENSURE_TYPE(circle, TiGooglemapsCircleProxy);

[[circle circle] setMap:nil];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#import "TiViewProxy.h"
#import <GoogleMaps/GoogleMaps.h>

@interface DeHansknoechelGooglemapsMarkerProxy : TiProxy<GMSMapViewDelegate>
@interface TiGooglemapsMarkerProxy : TiProxy<GMSMapViewDelegate>

@property(nonatomic,retain) GMSMarker *marker;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
* Please see the LICENSE included with this distribution for details.
*/

#import "DeHansknoechelGooglemapsMarkerProxy.h"
#import "TiGooglemapsMarkerProxy.h"
#import "TiUtils.h"

@implementation DeHansknoechelGooglemapsMarkerProxy
@implementation TiGooglemapsMarkerProxy

@synthesize marker = _marker;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@
*/

#import "TiModule.h"
#import "DeHansknoechelGooglemapsMarkerProxy.h"
#import "TiGooglemapsMarkerProxy.h"

@interface DeHansknoechelGooglemapsModule : TiModule {

}
@interface TiGooglemapsModule : TiModule

-(void)setAPIKey:(id)value;
-(NSString*)version;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
* Copyright (c) 2015 Your Company. All rights reserved.
*/

#import "DeHansknoechelGooglemapsModule.h"
#import "TiBase.h"
#import "TiHost.h"
#import "TiUtils.h"
#import "DeHansknoechelGooglemapsMapViewProxy.h"
#import "TiGooglemapsModule.h"
#import "TiGooglemapsMapViewProxy.h"
#import <GoogleMaps/GoogleMaps.h>

@implementation DeHansknoechelGooglemapsModule
@implementation TiGooglemapsModule

#pragma mark Internal

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* This is a generated file. Do not edit or your changes will be lost
*/

@interface DeHansknoechelGooglemapsModuleAssets : NSObject
@interface TiGooglemapsModuleAssets : NSObject
{
}
- (NSData*) moduleAsset;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/**
* This is a generated file. Do not edit or your changes will be lost
*/
#import "DeHansknoechelGooglemapsModuleAssets.h"
#import "TiGooglemapsModuleAssets.h"

extern NSData* filterDataInRange(NSData* thedata, NSRange range);

@implementation DeHansknoechelGooglemapsModuleAssets
@implementation TiGooglemapsModuleAssets

- (NSData*) moduleAsset
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#import <GoogleMaps/GoogleMaps.h>
#import "TiUtils.h"

@interface DeHansknoechelGooglemapsPolygonProxy : TiProxy
@interface TiGooglemapsPolygonProxy : TiProxy

@property(nonatomic,retain) GMSPolygon *polygon;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* Please see the LICENSE included with this distribution for details.
*/

#import "DeHansknoechelGooglemapsPolygonProxy.h"
#import "TiGooglemapsPolygonProxy.h"

@implementation DeHansknoechelGooglemapsPolygonProxy
@implementation TiGooglemapsPolygonProxy

@synthesize polygon = _polygon, path = _path;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#import <GoogleMaps/GoogleMaps.h>
#import "TiUtils.h"

@interface DeHansknoechelGooglemapsPolylineProxy : TiProxy
@interface TiGooglemapsPolylineProxy : TiProxy

@property(nonatomic,retain) GMSPolyline *polyline;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* Please see the LICENSE included with this distribution for details.
*/

#import "DeHansknoechelGooglemapsPolylineProxy.h"
#import "TiGooglemapsPolylineProxy.h"

@implementation DeHansknoechelGooglemapsPolylineProxy
@implementation TiGooglemapsPolylineProxy

@synthesize polyline = _polyline, path = _path;

Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions iphone/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ def generate_doc(config):
return documentation

def compile_js(manifest,config):
js_file = os.path.join(cwd,'assets','de.hansknoechel.googlemaps.js')
js_file = os.path.join(cwd,'assets','ti.googlemaps.js')
if not os.path.exists(js_file):
js_file = os.path.join(cwd,'..','assets','de.hansknoechel.googlemaps.js')
js_file = os.path.join(cwd,'..','assets','ti.googlemaps.js')
if not os.path.exists(js_file): return

from compiler import Compiler
Expand Down Expand Up @@ -101,7 +101,7 @@ def compile_js(manifest,config):

from tools import splice_code

assets_router = os.path.join(cwd,'Classes','DeHansknoechelGooglemapsModuleAssets.m')
assets_router = os.path.join(cwd,'Classes','TiGooglemapsModuleAssets.m')
splice_code(assets_router, 'asset', root_asset_content)
splice_code(assets_router, 'resolve_asset', module_asset_content)

Expand Down
Loading

0 comments on commit 9fd7a0c

Please sign in to comment.