For users who may not be familiar with WhirlyGlobe, here's the summary.
WhirlyGlobe is a 3D globe rendering toolkit for iPad and iPhone. It lets you put labels, markers, and vectors on top of a 3D interactive globe with a base layer of pageable image data.
Who It's For & What It Is
The Component is for people who wanted to use WhirlyGlobe, but had trouble compiling it, getting it to run, or dealing with the threading. You know, most everyone.
WhirlyGlobe Component is most of the interesting functionality without all the stuff that drove people crazy. It's all Objective C, there are no weird template headers to include, and you can safely ignore threading issues. Don't get me wrong, all that's still in there, I'm just hiding it.
Where To Get It
I'm putting the WhirlyGlobe Component into beta right now. You can get the latest version off WhirlyGlobe's github download section.
There are two main pieces in that download:
- WhirlyGlobeComponent.framework
- WhirlyGlobeComponentTester
The Tester is my test app. It's self documenting (Ha! I kill me). Just load it up and check out TestViewController.m. All the important logic is in there.
Using The Framework
It's much easier to include the WhirlyGlobe Component framework in your own project. That's the whole point.
When setting up a new project, here's all you have to do.
- Drag WhirlyGlobeComponent.framework into your project view.
- Add the following standard Apple frameworks that WhirlyGlobe needs.
- OpenGLES
- QuartzCore
- libsqlite3
- libstdc++
- Point the Header Search Paths at the WhirlyGlobeComponent.framework/Headers directory.
- Add -all_load to the Other Linker Flags. You'll get a missing selector without this.
To actually create a WhirlyGlobeViewController and use it, look at TestViewController.m in the WhirlyGlobeComponentTester app.
Future
At the moment I'm supporting a variety of base image layers, both remote and local, paged and not. I'm also supporting markers and labels in both 2D and 3D modes. Selection is working, as is UIView overlay.
The only big feature missing is vector data. I'm contemplating how best to include that in an intuitive way. Barring a little testing, that's the last feature before release. In the mean time, it works great, give it a try.
I think you need to add "-all_load" to "Other Linker Flags" in order to not get an uncaught exception thrown. By the way, this is really cool!
ReplyDeleteYes, good catch. Thanks.
ReplyDeleteGreat. A beautiful piece of software, Thanks a lot for sharing.
ReplyDeleteRegards, Bjørn Asle
btw; the paths as distributed in your latest beta zip needs a bit of work ;)
Thanks!
DeleteTell me more about the paths. I'd like to make this as simple as possible.
Hope it´s not my sligthly modified Xcode that´s causing this, but when I used
Delete"WhirlyGlobeComponentDistribution_0_93.zip" the header path was pointing to ../../WhirlyGlobeSrc and maps/geojson etc had to be correctly referenced as well. Basically all headers and resources.
Not a biggie to change at all, but for the casual developer it breaks with a zillion not found messages.
Cheers, Bjørn Asle
Great project, and I can't wait to get it working myself, but I'm having the 'casual developer' problem (not that long an Xcode programmer), and I'm seeing those zillion messages pointing to folders that don't exist. Is there a detailed explanation available of how to arrange the folders/paths to make everything work? Do I need to have both the full API setup and the Component setup on my drive? Where should they be? I feel 'so near yet so far'. Thanks, Ted
DeleteThe problem is the path to resources in the project. It's pointing somewhere you don't have, even though all the files are in the distribution.
DeleteIf you click on the resources node in the project, you can edit the path and just point it to the resources directory in WhirlyGlobeComponentTester.
You could also just delete the resources node and then drag the resources folder right into the project under WhirlyGlobeComponentTester.
I'll also update the distribution. Doh!
does the whirlyglobe component has the same functionality as the older whirlyglobe.framework ?, i mean can i do everything i was doing with the older framework?
ReplyDeleteIt's a subset of functionality, but it's the vast majority of what most people were doing.
DeleteIf you have a working app then it probably makes less sense to switch over. I'm not going to close the API or anything.
What does your app do?
I've been using WhirlyGlobeComponent for an internal project and I just upgraded XCode and got a "ld: file is universal (2 slices) but does not contain a(n) armv7s slice" error. I was still using the 0.93 version of the component and am downloading the 1.0 version, but I thought I'd let you know. I'm using the globe to display our market regions for a training app and the users are really enjoying playing with the maps.
ReplyDeleteYou should upgrade to 1.0, I think, but that won't fix it.
ReplyDeleteHere's a good explanation:
http://stackoverflow.com/questions/12402092/file-is-universal-3-slices-but-does-not-contain-an-armv7s-slice-error-for-st
You will not lose support for the iPhone5 if you follow those instructions, just a few optimizations in the instruction set.
I will, of course, update the Component, but it may be a few days.
Thank you for the reference to the stackoverflow question. I will upgrade the project to the 1.0 version and follow those instructions and keep an eye out for your update. Thank you for providing such a cool tool.
DeleteChris
Happy to and shoot me a picture or two of your app if you can.
DeleteI never publish those without permission, but it's still fun to see what people are doing.
Sure thing.
DeleteThis comment has been removed by a blog administrator.
ReplyDeleteIs it possible through the use of google earth images or just other earth images to continue the zoom levels all the way down to ground level?
ReplyDeleteYou can't use Google data, but you can add your own data, make something with TileMill or use a service like MapBox.
DeleteThis comment has been removed by the author.
ReplyDeleteThis comment has been removed by the author.
ReplyDeletehow create object like MaplyMarker (the label lies on globe plane) but with zoomable (scales) like MaplyScreenLabel
ReplyDeleteThere's a MaplyLabel, but that's just a 3D label like the 3d MaplyMarker. There isn't an object that changes size with the zoom and lies on the screen plane.
ReplyDeleteHow to set background color with Clear color
ReplyDeleteif I set globe.clearColor = [UIColor clearColor] i get black BG
It's complicated. Here's an explanation:
Deletehttps://github.com/mousebird/WhirlyGlobe/issues/28
Still this issue does not explain how to set the color of the globe (and not the background behind the globe..
DeleteYeah, the question is just about setting the background color of the OpenGL and UIView. To set the color of the globe you'd need to have a base map. You can further modify those colors with a UIColor of your own on the MaplyQuadImageTilesLayer.
DeleteHow would you go about changing the color? I understand you need to edit the base map, but how or where in terms of code do you make this so?
DeleteCan you help me ho create correct pvrtc from some png Image (size 1944X1944) for map?
ReplyDeleteThat's what ImageChopper is for: https://code.google.com/p/whirlyglobe/wiki/Imagery
DeleteDocumentation's a bit out of date. Just run it to see what the options are.
Hm all good when compile (no error) but when I added to proj texture does not want load and all pvrtc file (open in xcode) shows ™∆úßî™™™™∆úßî™™™™∆úßî™™™™∆úßî™™™™∆úßî™™™™∆úßî™™™™∆úßî™™™™∆úßî™™™™∆ú¶î™™™™∆úßî™™™™∆úßî™™™™∆ú¶î™™™™∆úßî™™™™∆úßî™™™™∆úßî™™™™∆ú¶î™™™™∆úßî™™™™∆úßî™™™™∆úßî™™™™∆úßî™™™ do you has any idea about it?
DeleteXcode doesn't recognize PVRTC.
ReplyDeleteOnce you've created the tile set with ImageChopper, you need to load it with addSphericalEarthLayerWithImageSet: on the globe view controller. You give it the name of the plist like so:
WGViewControllerLayer *layer = [globeViewC addSphericalEarthLayerWithImageSet:@"lowres_wtb_info"];
In 2.2 relesed, MaplyScreenLabel looks very blurry, and with transparent in old build all be ok, Can you help me, maybe you know where is problem.
ReplyDeleteP.S. Set clear background color dont fixed, I still cannot set [UIColor clearColor], so I load sources and fix by my self =)
Can you send a screen shot? And what hardware are you running on? Make sure the blurriness happens on the device and not just the simulator.
DeleteWith 2.2 I moved to font based rendering and it saves a lot of CPU and memory, but the result may be different. I could tweak this a bit if it's clear what the problem is.
iOS 6, iPhone 5, latest code from git.
ReplyDeletehttps://www.dropbox.com/s/md643qiqqc4tn1q/map.png - screen (in prev version font was be like country border lines)
_screenLabelDesc = @{kMaplyTextColor: screenLabelColor, - white
kMaplyBackgroundColor: screenLabelBackColor, - clear
kMaplyFont: [UIFont systemFontOfSize:12.0]
I'll take a look. In the mean time you can make them more distinct by giving the text an outline (say, in black).
DeleteCan you leave a comment when you fix this issue?
DeleteIt might be easier to track the issue: https://github.com/mousebird/WhirlyGlobe/issues/61
DeleteThere's a fix in the develop branch.
DeleteBuild new developer brach but get 11 warnings like
Deleteld: warning: direct access in WhirlyKit::DrawableChangeRequest::execute(WhirlyKit::Scene*, WhirlyKitSceneRendererES*, WhirlyKitView*) to global weak symbol boost::detail::spinlock_pool<1>::pool_ means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
Can you help me remove this warning?
I see that occasionally, then it'll disappear, which suggests it's the compiler being dumb.
DeleteNo idea how to get rid of it, I'm afraid.
Also, for issues like this please go use the github page.
This comment has been removed by the author.
ReplyDeleteHi, I need help in one more problems, it is centered MaplyScreenLabel in country. I use
ReplyDeleteMaplyCoordinate center;
[wgVecObj largestLoopCenter:¢er mbrLL:nil mbrUR:nil];
MaplyScreenLabel *screenLabel = [[MaplyScreenLabel alloc] init]
screenLabel.loc = center;
But founded center is not good, its shows for example on Norway an Sweden
P.S. screen https://www.dropbox.com/s/oo1f7yt29c2c11m/Map1.png
Can you ask this over on github?
ReplyDeletehttps://github.com/mousebird/WhirlyGlobe/issues
This comment has been removed by the author.
ReplyDeleteThis is really cool. But how we can change theImage icon for the Geography class- Mapbox Tiles-Local.
ReplyDeleteIf my understanding is not wrong then you are using this code to get the map.
[baseViewC addQuadEarthLayerWithMBTiles:@"geography-class"];
That setup is pretty old. Take a look at WhirlyGlobe-Maply 2.2, which is just about to be formally released.
Deletehttp://mousebirdconsulting.blogspot.com/2013/11/whirlyglobe-maply-22-beta4.html
Thanks for your input. But in the old version which i was using is having the zooming problem. I didn't find any method or property to set the zooming level.
ReplyDeleteWhat version is this?
DeleteI am using 2.1.
DeleteLook for the height attribute on the WhirlyGlobeViewController. The units are height above the surface of the earth where the earth has a radius of 1.0.
DeleteThis comment has been removed by the author.
DeleteOk i will check this
Deletecan we set the color of globe?.By default map is having a unique/particular color assigned to each country. My requirement is when i load the map it should fill the color of country based on some input.
ReplyDelete