WARNING: this code is still in test, it has not been reviewed.
Javascript wrapper still has to be written, for now it is direct call
to objectivec code.
WARNING 2: it is only for iphone
Follow discussion :
http://groups.google.com/group/phonegap/browse_thread/thread/b6b4f50398a3d114/008e9371b28975c8?q=openmap&lnk=ol&
Javascript Usage:
0) to init PhoneGap.exec("Map.init")
1) To add points
PhoneGap.exec
("Map.addPoint",latitude,longitude,title,subtitle,"purple","processmapclick
('"+data[i].nid
+"')");
2) to display the map
PhoneGap.exec("Map.center",geoParams.lat,geoParams.long,0.4,0.4);
3) to reset and hide the map (I call it via a tabbar)
PhoneGap.exec("Map.reset")
To integrate:
1) begin as usual : http://phonegap.pbworks.com/Getting+Started+with+PhoneGap+(iPhone)
2) go into phonegap-iphone folder
3) replace map.h & map.m with
http://www.programmers.ch/phonegap/Map.h
http://www.programmers.ch/phonegap/Map.m
4) ..don't know if it is necessary -> open phonegaplib project &
rebuilt it
5) go into phonegap-iphone folder (& type make)
6) reinstall the generated pkg
... that's it ....
Undefined symbols:
".objc_class_name_MKMapView", referenced from:
literal-pointer@__OBJC@__cls_refs@MKMapView in libPhoneGapLib.a
(Map.o)
".objc_class_name_MKPinAnnotationView", referenced from:
literal-pointer@__OBJC@__cls_refs@MKPinAnnotationView in
libPhoneGapLib.a(Map.o)
ld: symbol(s) not found
Could you help me ?
Canvin.
On 3 fév, 10:10, hanger <mkalb...@gmail.com> wrote:
> I (finally) integrated mapkit into the latest iphone/phonegap
>
> WARNING: this code is still in test, it has not been reviewed.
> Javascript wrapper still has to be written, for now it is direct call
> to objectivec code.
> WARNING 2: it is only for iphone
> Follow discussion :http://groups.google.com/group/phonegap/browse_thread/thread/b6b4f503...
>
> Javascript Usage:
> 0) to init PhoneGap.exec("Map.init")
> 1) To add points
> PhoneGap.exec
> ("Map.addPoint",latitude,longitude,title,subtitle,"purple","processmapclick
> ('"+data[i].nid
> +"')");
> 2) to display the map
> PhoneGap.exec("Map.center",geoParams.lat,geoParams.long,0.4,0.4);
> 3) to reset and hide the map (I call it via a tabbar)
> PhoneGap.exec("Map.reset")
>
> To integrate:
> 1) begin as usual :http://phonegap.pbworks.com/Getting+Started+with+PhoneGap+(iPhone)
> 2) go into phonegap-iphone folder
> 3) replace map.h & map.m withhttp://www.programmers.ch/phonegap/Map.hhttp://www.programmers.ch/phonegap/Map.m
> > 3) replace map.h & map.m withhttp://www.programmers.ch/phonegap/Map.hhttp://www.programmers.ch/pho...
Now i'll try to play with it. I'll post my progress (like add polygon
and Javascript wrapper).
Canvin.
- (void) center:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options;
{
NSUInteger argc = [arguments count];
float longitude,latitude,longitutedelta,latitudedelta;
if (argc > 0) latitude = [[arguments objectAtIndex:0] floatValue];
if (argc > 1) longitude = [[arguments objectAtIndex:1] floatValue];
if (argc > 2) latitudedelta = [[arguments objectAtIndex:2] floatValue];
if (argc > 3) longitutedelta = [[arguments objectAtIndex:3] floatValue];
NSLog(@"map:center");
/*
NSLog(@"lattitude %@",latitude);
NSLog(@"longitude %@",longitude);
NSLog(@"latitudedelta %@",latitudedelta);
NSLog(@"longitutedelta %@",longitutedelta);
*/
MKCoordinateRegion region;
MKCoordinateSpan span;
span.latitudeDelta=latitudedelta;
span.longitudeDelta=longitutedelta;
CLLocationCoordinate2D location;
if (latitude!=0){
location.latitude=latitude;
location.longitude=longitude;
} else {
location=mapView.userLocation.coordinate;
}
region.span=span;
region.center=location;
[mapView setRegion:region animated:TRUE];
[mapView regionThatFits:region];
UIViewController* c = [super appViewController];
[c.view insertSubview:mapView atIndex:1];
canReset=true;
}
--
You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to
phonegap+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
For more info on PhoneGap or to download the code go to www.phonegap.com
Shaz
Ok, for the "continually re-center the map", I think you
missunderstood the way to use
PhoneGap.exec("Map.center",geoParams.lat,geoParams.long,0.4,0.4); is
called only once, (after you added all points)
To say it quickly : only "addPOint" is called multiple times
If you forget the long/lat delta, probably it will generate a
segfault, default values should be added.
Good idea for the maptype.
For publication & people working on the file ... that's a good
question . Seems that Shazron is triing to find out. I published
this because there were people asking for such feature, but I didn't
get any feed backs from the phonegap team.
I wish if it could be intergrated into the edge repository, but it's
not up to me. So for now ... I published it here ... future will tell
us if there will be a more clever way to work on that shared code ...
Marc
> >http://groups.google.com/group/phonegap/browse_thread/thread/b6b4f503...
hope you release the js wrapper soon :).
Canvin
> >>http://groups.google.com/group/phonegap/browse_thread/thread/b6b4f503...
You guys are moving much too slowly for me and are doing a poor job of communicating your intentions through the list and the bug tracker.
Stuff I filed mid last week hasn't even been assigned until just now and you seem to be hinting and new direction for some mechanisms, but you're doing a lousy job explaining the future.
Not cool. WTF is the "new EventBroadcaster mechanism"?
Seriously, at this point I'm considering simply forking because what works is fine (like audio) and we seem to be having a lot of duplicated effort on the stuff that is half baked like file.
File was a huge amount of work and I've just finished it (about to start testing).
I'm happy to upload my current state for your examination. But I'm getting the idea that PhoneGap is a hobby for nitobi and for me it has just become my job. I've got clients and deliverables and field tests in 3 weeks. So whatever "sort of works" is fine with me. Whatever is "just a placeholder" needs urgent attention. Moreso than any kind of grand "rethinking of notifications".
That's my $.02. Please improve your project communication. This isn't your private toy anymore.
Isn't the the aim of having versions ?
mapkit or file integration could be considered as "extra
functionnalities" and could be implemented using 0.x edge git.
While Nitobi (or whatever) could work in extra "core" functionnalities
or refactoring or setting up a new framework in a new branch that
would end up as a new version of phonegap (1.x).
Whatever, it's not the first time I ask ... HOW TO CONTRIBUTE ...
More over there was an strange issue when using the tabbar. It was
calling (resetfavorite ) etc .. I added the following lines but it's
just a VERY DIRTY workaround .. my deadline was for yesterday .. no
time to do a clean work
- (void) resetfavorite:(NSArray*)arguments withDict:(NSDictionary*)
options;
- (void) resetabout:(NSArray*)arguments withDict:(NSDictionary*)
options;
....
> >>>http://groups.google.com/group/phonegap/browse_thread/thread/b6b4f503...
I am evaluating various iphone rapid development tools and also find
the ad-hoc approach of the PhoneGap team somewhat frustrating. The
lack of a clear roadmap and documentation have proved very unsettling
when deciding to commit to this approach on anything more than a hobby
level. Unfortunately, PhoneGap does seem to offer the best balance of
low barrier to entry and feature set, and since I will eventually be
handing these custom app development projects to others, it seems I'm
stuck with PhoneGap.
I just wanted to take a moment to thank you for releasing your code.
Given the lack of a real native mapping implementation in PhoneGap,
this will hopefully bridge the gap until whenever PhoneGap can
implement something themselves. If I uncover any bugs, how would you
like to hear about them?
Now if only I could just figure out why navigational elements aren't
working I could finally finish this damn app. Hopefully I won't have
to punt and drop down into Obj-C.
As far as I'm concerned, you can close my ticket "Media does not call completion callbacks". I fixed it. It works great. Changing it over now to use some not yet introduced NSNotificationCenter clone will NOT make me happy if it breaks my existing code. This is what I really worry about.
PG has users who are (almost) shipping stuff on tight deadlines (notably ME). DO NOT BREAK IT because you've dreamed up "a better way".
Assign bugs as soon as they come in. I still think it is inexcusable that there was no bug stating that "file basically only kind of works a little for one specific case of reading text" until I filed it a couple days ago and then set out to fix it, only to learn that someone else has been working on it for a couple months?
Gosh, I sure wish I had that 20 hours of development back then (of which, I'm starting hour 21 - probably I should go get some sleep and stop being my extra cranky sleep deprived self).
I'm gonna try reading my audio file and then go get some sleep.
-Todd Blanchard
Post to list or email me. PG is now my full time job. :-) We'll be starting android development in a couple weeks too.
FWIW, I spent some time trying to get google maps v3 playing nice with jqtouch - there's a really weird bug that is keeping it from working and its caching behavior isn't nearly as good as mapkit, so I think mapkit is definitely the way to go.
-Todd Blanchard
You can probably resize the mapkit view created in map::init
add this code to add the blue dot (mapView.showsUserLocation=true; )
with your current location otherwise there is an exception.
In Map.m
(MKAnnotationView *) mapView:(MKMapView *)mapView viewForAnnotation:
(id <MKAnnotation>) annotation{
...
if ([annotation class] == MKUserLocation.class) {
return nil;
}
}
Canvin.