mousebird-consulting-inc / whirlyglobe Goto Github PK
View Code? Open in Web Editor NEWWhirlyGlobe Development
License: Other
WhirlyGlobe Development
License: Other
This is more a question than an issue, but here it goes.
I'm looking into adding 3D objects on top of the globe, so they follow the globe while rotating and actually look bigger when they are closer to the camera and become smaller and properly hide away behind the globe when they reach any edge.
From what I've seen the current 3D markers behave like "stamps" on the globe, like they're glued to it, what I want to achieve is something that is either floating above the globe or sticking out from it.
Do you have any advice on how to achieve this?
With the ability to add UIView overlays comes the next idea of making them interactive. I added buttons to one, and found that they worked fine on iOS 6. However, on iOS 5, the button is ignored, and the gesture for the globe (a tap) took full control and the buttons have no effect.
I dug down to the gesture recognizer itself and set cancelsTouchesInView which allowed the button to be triggered instead:
UITapGestureRecognizer *tappy = [[[[[[self.view subviews] objectAtIndex:4] subviews] objectAtIndex:0] gestureRecognizers] objectAtIndex:1];
tappy.cancelsTouchesInView = NO;
This worked great on iOS 5, but in turn makes iOS 6 stop working. By checking the version, both can be made to work, of course.
Would it be possible for WhirlyGlobe to check the version of iOS and set this value appropriately by default?
Thanks,
Andrew
Thanks for the shader example! Is there a description of what all the uniforms can be/etc? Not really a bug since it's in the demo, but the WX fragment shader makes everything white... changed this to make it color:
mix(vec4(baseColor0.r,baseColor0.g,baseColor0.b,baseColor0.a),vec4(baseColor1.r,baseColor1.g,baseColor1.b,baseColor1.a),u_interp);
Of course.. maybe you were going for the hazy shade of winter look... :)
After completing a zoom operation, it seems that WG loads all the intermediate levels of tiles. It would be nice if it only loaded the lowest level of detail of tiles. This could be a setting on the view controller it self or (ideally) even for each layer
Hi,
I'm trying to use whirly. The code below works and allows me to create a 3D globe with tiles fetched from my custom tile source.
//THIS CODE WORKS (3D globe)
globeViewC = [[WhirlyGlobeViewController alloc] init];
globeViewC.delegate = self;
baseViewC = globeViewC;
//THE CODE BELOW IS THE SAME FOR BOTH CASES
//init with yellow background
baseViewC.clearColor = [UIColor yellowColor];
//add our subview - etc..
[self.view addSubview:baseViewC.view];
baseViewC.view.frame = self.view.bounds;
[self addChildViewController:baseViewC];
//init my tilesource
MyCustomTilesource* ctSource = [[MyCustomTilesource alloc] init];
MaplySphericalMercator* coordSystem = [[MaplySphericalMercator alloc] initWebStandard];
//create a layer
MaplyQuadImageTilesLayer *layer = [[MaplyQuadImageTilesLayer alloc]
initWithCoordSystem:coordSystem
tileSource:ctSource];
//set a few settings
baseLayer = layer;
layer.handleEdges = true;
layer.coverPoles = true;
//add the layer to our baseview
[baseViewC addLayer:layer];
layer.drawPriority = 0;
Now I'm trying to project the same tile source, but this time in a 2D flat map.
All I'm changing is the 3 lines of code below, but instead of getting a map I get a yellow background. Am I missing something on how Whirly works?
//THIS CODE DOES NOT WORK (2D)
mapViewC = [[MaplyViewController alloc] initAsFlatMap];
mapViewC.delegate = self;
baseViewC = mapViewC;
//THE CODE BELOW IS THE SAME FOR BOTH CASES
//init with yellow background
baseViewC.clearColor = [UIColor yellowColor];
//add our subview - etc..
[self.view addSubview:baseViewC.view];
baseViewC.view.frame = self.view.bounds;
[self addChildViewController:baseViewC];
//init my tilesource
MyCustomTilesource* ctSource = [[MyCustomTilesource alloc] init];
MaplySphericalMercator* coordSystem = [[MaplySphericalMercator alloc] initWebStandard];
//create a layer
MaplyQuadImageTilesLayer *layer = [[MaplyQuadImageTilesLayer alloc]
initWithCoordSystem:coordSystem
tileSource:ctSource];
//set a few settings
baseLayer = layer;
layer.handleEdges = true;
layer.coverPoles = true;
//add the layer to our baseview
[baseViewC addLayer:layer];
layer.drawPriority = 0;
Thank you.
I'm using a height
of 0.5f
so the globe is pretty big and I actually only see it partially. The problem with this is that WGMarker and WGViewTracker aren't hiding properly when the globe rotates and they're supposed to be in the back.
You can look at it in this video: http://f.cl.ly/items/1w3u3D261e3r060D0V1r/IMG_1242.MOV
If you could give me some pointer I could take a shoot at this, right now I'm kind of lost on where to look at.
If I call ImageChopper with three arguments (which the usage note implies is ok), it just prints out the usage note.
If I change the initial argument check to allow just 3 arguments, I get this error instead, which is more helpful:
Must specify -singleres or -multires
Might I suggest that you change that initial check?
Currently, the way to define what color is behind the globe is:
// Set the globe's view background
[globeViewC.view setBackgroundColor:[UIColor clearColor]];
// Set the background color for the globe
globeViewC.clearColor = [UIColor clearColor];
This works for all cases except clearColor, because the WhirlyKitEAGLView view is a subview of globeViewC.view and seems to be defaulting to black. Finding and setting that view's background color works, but doesn't feel like a solid solution.
Could there be a single function of the WhirlyGlobeViewController that sets all three of these at once, perhaps:
[globeViewC setBackgroundColor:[UIColor clearColor]];
After that the code could specifically set colors as needed for flexibility.
The other option is providing access to the WhirlyKitEAGLView via the WhirlyGlobeViewController, and letting the developer set each one individually:
[globeViewC.glview setBackgroundColor:[UIColor clearColor]];
Thanks,
Andrew
I do not understand why all this code isn't a part of the lib. It is very useful..
Code like this:
[self.wgVC addSphericalEarthLayerWithImageSet:@"big_wtb_info"];
[self.wgVC addQuadEarthLayerWithMBTiles:@"mbtile-file"];
tends to show the mb tiles with 'rips' at the corners when zoomed out. When zoomed in, it looks pretty reasonable.
I've tried this with both the 2.0 release and the develop branch.
Can Image Chopper import an image without decreasing it resolution ?
The third party clipper library namespace was previously "clipper".
It's now changed to "ClipperLib".
You should change your using namespace statements accordingly.
using namespace clipper;
should be changed to
using namespace ClipperLib;
in file GridClipper.m
Hi,
How can I do and use multires images ?
Best regards,
WhirlyGlobeApp has been largely replaced by the Component Tester, but it could still work. Update it.
If you pull the current version of the https://github.com/iosmapper/WhirlyGlobe/tree/develop
And run the terrain test you will see the below image. It looks like the closest tiles are being requested at higher zoom levels.
Hi,
I've succesfully created and loaded my custom viewcontroller when a marker is tapped.
Now I want to grab gesture on the overlay (like if it becomes the first responder or gets a "modal" behaviour).
I've tried to call becomeFirstResponder from the subview or pushing it on the top but it doesn't work.
Before I start to investigate I'd like to ask you some suggestion...What approach I should follow?
I saw that you're pushing notifications when the user taps and I looked at TapDelegate.mm... but I don't want to break the underground stuff....
Thank you, and once again compliments...you did an amazing work (I've tried to add 10000 random markers and it's still fluid)
There's low-level support to create markers which are arrays of textures which animate over a specified period (with rotation). This should be exposed at the component level.
I'm using the sticker API to add a set of weather images to the globe. Running under instruments, I see memory use growing amazingly. I'm updating the weather data every minute, and I remove the 'old' MaplyComponentObjects and add the new imagery. In doing a little debugging, I can see the chunks being released, but it looks like the UIImages associated with the textures are not being freed, thus the huge use of memory (20GB in the worst case).
Any suggestions?
Maybe you already know about this, but about 60% of the time, I get a crash when I add the animated layer.
Repro Steps:
On this line in stl_vector.h:400:
{ return size_type(this->_M_impl._M_finish - this->_M_impl._M_start); }
I've got code that's managing a set of mbtiles files downloaded from the web. There's no API in the WhirlyGlobeViewController that allows me to deal with this:
we have - addQuadEarthLayerWithMBTiles: which loads an MBTiles file from the Resources directory.
I think we need -addQuadEarthLayerWithDataSource: that takes an object conforming to WhirlyGlobeQuadTileImageDataSource.
It would be nice if there were methods to also remove a layer with a particular datasource.
I'm planning on writing an aggregating datasource that allows me to turn on and off MBTile sets.
Let me know if there's a sane way of doing this.
Latest code (animation demo - FWIW, very cool!)
TileQuadLoader:425
skirtDraw->setTexId(texIds[0]);
Fails with an EXC_BAD_ACCESS when panning and zooming. Repro steps:
loading an MBTiles file returns a MaplyViewControllerLayer. There needs to be a way to set the drawPriority on the underlying tileLoader.
The existing api for loading mbtiles and shape files is by name, which is then found in the resource bundle. There needs to be api which allows loading of such resources from a user-specified path.
I'm sorry if it's a noob issue, but I cannot get the Globe to show pins at correct positions.
I tried animateToPosition:time: with (45, 18) on viewDidLoad for example and it turned Globe to some location in Africa, although it should be in Europe. I have also added WGScreenMarker at the same (45, 18) to make sure it works incorrect in both ways.
Thank you!
In the sample code, WhirlyGlobeTester, I added the following lines to fill the country shapes with a solid colour.
[globeViewC setVectorDesc:@{
@"color": [UIColor blueColor],
@"filled" :@(YES),
@"width":@(5.0)}];
Apparently, it works for small areas that are predominantly flat, but fails to fill properly for bigger countries like China/USA.
The screenshot below is what I see when I turn "Countries" to On after setting the filled property to YES.
Is this a known issue? Are there any workarounds to get a smooth fill throughout the shape?
Currently landscape mode cannot be adjusted to zoom out where the entire globe is visible. The max zoom limit is approx. 1.1 and cannot be overwritten by setting zoom limits.
I haven't seen this yet on the device, but about 10% of my starts under the simulator, the globe view shows as all black. Rendering stickers and such show nothing.
This is under iOS 6.0 in Xcode 4.6 in the latest develop branch. I see no log messages, perhaps it's an OpenGL issue?
WhirlyGlobe/WhirlyGlobeSrc/WhirlyGlobeLib/include/Scene.h:34:9: 'ActiveModel.h' file not found
Using screenPointToGeo: to get the screen position of a marker will return valid values for a marker that is not visible (on the back side of the globe). Need a way to determine whether a marker is visible to avoid this.
Hi,
Is there any way to get the click event of WGViewTracker.view? Actually I am adding a UIButton on WGViewTracker.view and need to get the click event. Because I have to send the request to server on click event.
Any help will be really appreciated.
Thanks!
I'm fixing the globe to the north on a project and everything works well except when I reach the poles. Say if you're slowly rotating to the south and go past argentina it will wildly rotate "horizontally" instead, so you may end up in new zealand or anywhere else that is on the south.
I think this is really confusing, it would be better if we don't allow to rotate anymore if the user insists to drag on a south direction, than rotating to the sides.
What I've tried is looking at newRotQuat
(in PanDelegateFixed.mm) and if it goes below certain values then I don't set that new rotation to the globeview ([view setRotQuat:(newRotQuat)]
), but clearly I don't really seem to understand quaternions since I'm going nowhere.
Can you suggest an approach to solve this problem?
Is there a way to return the 'Tap at' co-ord in:
I've downloaded the latest WhirlyGlobeComponent.framework and integrated it into my app under development (pretty easy to do, btw). But I'm experiencing a memory issue that I can also reproduce in the WhirlyGlobeComponentTester:
If I profile the ComponentTester in the iPhone 5.1 Simulator or iPhone 6.0 Simulator, using the Allocations Instrument, and do the following:
BTW: In my app, I use a higher resolution image set for the call to addSphericalEarthLayerWithImageSet, so I'm seeing a ~20MB increase per call to the globe.
ld: file is universal (2 slices) but does not contain a(n) armv7s slice: ../WhirlyGlobeComponent.framework/WhirlyGlobeComponent for architecture armv7s
This happens because Xcode 4.5 has dropped support for armv6
Latest push of WG includes a libjson reference that doesn't seem to be in github.
The UIScrollView option in the tester app is not hooked up.
The sides are fine, but the tops are showing up in the middle of nowhere. WhirlyGraph or WhirlyGlobeTester.
CocoaPods can use a LICENSE file when generating documentation. If WhirlyGlobe provided its license terms in a LICENSE file, that would be helpful.
This is not really a bug, but it could be improved if there was an option to use more vertices to create the globe. (which I guess would make it more cpu intensive?)
Here's an example with height
at 0.5f
: http://f.cl.ly/items/3943111K033h423f3k41/Captura%20de%20pantalla%2003:01:13%2012:57.png
I want to use Whirly Globe (and possibly Maply) with my own offline custom Tile source. I have 2 options.
Does the framework support this and if yes can you point me to a possible example?
Sometimes the whirlyglobe crashes in this line:
[context presentRenderbuffer:GL_RENDERBUFFER];
To be more concrete here is the stacktrace :
And the assembly code:
This is more frequent when the app enters background.
I supose this has to due with openGL calls when the app is in the background. Apple kills applications that does this calls instantly. Is there any way to stop all calls to opengl before moving to the background?
I have set up a project that includes the WhirlyGlobe-MaplyComponent xcode project as subproject as well as other subprojects. The "-all_load" linker flag that WhirlyGlobe requires on the parent project messes with my other libraries and the code fails to compile. It there any way not to use it or use for example -force_load to specifically set the required libraries?
I've been toying around with this framework a bit recently, and I've got to say it's very nice, but I've noticed some issues โ namely the fact that there's a gaping hole at the North/South poles when using anything but the local low-res textures:
And now with the remote OpenStreetMap textures:
Is there any way to fix this?
Given an elevation dataset with numx and numy of 20, TileQuadLoader::buildTile ends up calling interpolateElevationAtX with a range of 0..19.5. This has the effect of causing the edge set of elevations to interpolate between the elevation at index 19 and 0.
Interesting note: it looks like the tile loader actually builds up the tile twice. Once with a range of 0..19 with full steps (0,1,2,..19) and once again with 1/2 steps being called (0,0.5,1,1.5,..19.5). Would love to know why that's happening.
Supporting Info:
Here are the heights (in feet) that are being returned for a specific tile
Requesting Terrain Data zoom:11 x:618 y:742
0: 3786 3481 3222 3018 2936 3323 3474 3825 3501 3593 3773 3035 2241 1555 1847 2123 2526 2674 2113 1886
1: 4295 3862 3248 3402 3146 3360 3760 3717 3619 3881 3360 2769 2116 1601 2185 2566 3061 2497 2260 2024
2: 3596 3848 4029 3671 3481 3442 3638 4255 3917 4268 3894 2867 2051 1660 2884 3012 3268 2523 2625 2566
3: 3054 3852 4452 4124 3701 3711 3819 4265 4439 4610 3875 3022 2195 1788 2717 3451 3412 2648 3150 2841
4: 2946 3704 3829 4659 4288 4091 4055 4383 5039 4022 3780 3169 2470 1995 2835 3425 3832 3219 3757 3031
5: 2946 3271 3560 4383 4810 4820 4255 4862 5407 4508 3711 3009 2300 2051 2835 3419 3753 3793 4190 3842
6: 2575 2785 3284 3478 4472 4957 5233 5443 5102 3911 3911 3179 2510 2031 2277 2526 3225 3041 3868 3924
7: 2451 2648 2887 3488 3471 4331 5207 5515 4997 4475 3455 3048 2654 2103 2014 2123 2543 2986 3901 3415
8: 2352 2559 2792 3251 3694 4035 5256 6230 5456 4757 3875 3461 3058 2635 2270 1860 2323 2766 3353 2808
9: 2402 2585 2907 3320 3632 4459 5472 5630 5807 4797 4413 3963 3153 2434 2218 1808 2067 2874 3189 2641
10: 2539 2648 3041 3632 4285 4846 5141 4409 5049 5266 4898 3891 3028 2825 2270 1795 1909 2372 2493 2530
11: 2854 2910 2897 3281 3799 4731 5108 3871 4111 4478 4160 3327 2720 2336 2234 1972 1594 1913 2119 2470
12: 3189 3071 3143 3399 3878 4826 4721 4022 3583 4029 3976 2999 2526 2234 1975 1673 1549 1742 2224 2897
13: 2772 2664 2930 3320 4219 5220 5384 4636 3474 3035 2828 2631 2290 1969 1775 1598 1627 1709 1942 2444
14: 2474 2480 2674 3222 4022 5082 5187 4088 3556 3816 3215 2717 2651 2365 1972 1722 1483 1522 1837 2585
15: 2192 2359 2648 2946 3911 4196 4505 5102 4849 4577 3960 3140 3369 2795 2159 2185 1555 1362 1955 2362
16: 2178 2769 2927 3488 3268 3409 4537 5249 5518 4990 3914 3917 4203 2969 2605 2326 1663 1296 1663 1929
17: 2064 2234 2802 3340 2700 3566 3986 5039 4626 4938 5151 4797 3848 2851 2283 1903 1457 1230 1745 1965
18: 1949 2405 3130 3061 2493 3389 4134 4386 3504 4157 4573 4419 3501 2756 2320 1726 1440 1250 1394 1532
19: 1775 1923 2034 2156 2306 2858 3448 3481 2989 3740 3911 3314 3881 3409 2461 1919 1394 1296 1152 1263
Here are the calls to interpolateElevationAtX:Y: the first time around (no 1/2 steps)
2013-08-25 23:18:59.181 WhirlyGlobeComponentTester[46649:4403] x:0.000000 y:0.000000 alt:3786.089355
2013-08-25 23:18:59.181 WhirlyGlobeComponentTester[46649:4403] x:1.000000 y:0.000000 alt:3480.971191
2013-08-25 23:18:59.181 WhirlyGlobeComponentTester[46649:4403] x:2.000000 y:0.000000 alt:3221.784912
.....
2013-08-25 23:18:59.333 WhirlyGlobeComponentTester[46649:4403] x:18.000000 y:19.000000 alt:1151.574829
2013-08-25 23:18:59.333 WhirlyGlobeComponentTester[46649:4403] x:19.000000 y:19.000000 alt:1263.123413
^^^ last call -- matches up with altitude dataset above
Here are the first few and last few calls when there are 1/2 steps:
2013-08-25 23:18:59.663 WhirlyGlobeComponentTester[46649:4403] x:0.000000 y:0.000000 alt:3786.089355
2013-08-25 23:18:59.663 WhirlyGlobeComponentTester[46649:4403] x:0.500000 y:0.000000 alt:3633.530273
2013-08-25 23:18:59.664 WhirlyGlobeComponentTester[46649:4403] x:1.000000 y:0.000000 alt:3480.971191
2013-08-25 23:18:59.664 WhirlyGlobeComponentTester[46649:4403] x:1.500000 y:0.000000 alt:3351.377930
2013-08-25 23:18:59.664 WhirlyGlobeComponentTester[46649:4403] x:2.000000 y:0.000000 alt:3221.784912
2013-08-25 23:18:59.664 WhirlyGlobeComponentTester[46649:4403] x:2.500000 y:0.000000 alt:3120.078857
.....
2013-08-26 08:31:10.649 WhirlyGlobeComponentTester[46649:4403] x:18.000000 y:19.500000 alt:575.787415
2013-08-26 08:31:10.650 WhirlyGlobeComponentTester[46649:4403] x:18.500000 y:19.500000 alt:603.674561
2013-08-26 08:31:10.650 WhirlyGlobeComponentTester[46649:4403] x:19.000000 y:19.500000 alt:631.561707
2013-08-26 08:31:10.650 WhirlyGlobeComponentTester[46649:4403] x:19.500000 y:19.500000 alt:315.780853
^^^^ That's where the values are dropping off.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.