Unable to show layers in ArcGIS map after removing tiled map service layer - layer

This is a Esri ArcGIS specific question.
I wish to create a function to change basemap.
To test the concept, I created a map and added a ArcGISTiledMapServiceLayer
var tiled = new ArcGISTiledMapServiceLayer('http://services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer');
Next, I will remove the layer and add a ArcGISImageServiceLayer to stimulate a change basemap action
var image = new ArcGISImageServiceLayer("http://sampleserver6.arcgisonline.com/arcgis/rest/services/Toronto/ImageServer", {
imageServiceParameters: params,
opacity: 0.75
});
What I realised is after these [adding tiled, removing tiled, adding image] actions, no layers will be rendered
I tested other scenarios and these are the results:
1) If I do not remove the tiled layer, both layers get rendered
2) If I add only image layer, image layer get rendered
3) If I add only tiled layer, tiled layer get rendered
Do you guys have any advice as to why I cannot perform a remove layer action?
To make this question understandable, I created a sample fiddle that can illustrate my case. Simply remove the removeLayer comment in the fiddle and run it. You will notice as mentioned, nothing will be rendered.
https://jsfiddle.net/82qjh0wg/

If you remove the basemap layer (which will be the first layer you add to the map if you don't specify the basemap layer in the constructor) then the entire map object will stop rendering.
If you want to hide the basemap layer then your best option is to either use css or create a blank basemap and change the basemap to that.
You could also set the transparency of the basemap to hide it.

Related

React Native Maps renders 2 background layers - blurred effect

I have a React Native application that contains a (react-native-maps) mapview with several different polylines and polygons created from http request data. The problem is that the map renders the background twice as you can see in the attached picture. This second layer is always a bit larger and more out of focus than the actual layer (the polygon/lines match with coordinaates on the clear defined layer). Im wondering how this second background came to be and how to prevent it from rendering.
Kind regards
Are you saying, that without providing an you are getting two layers?
Otherwise, when you use a different provider, for a layer and want to hide the layer provided by google, You should set mapType to "none".

Blender .fbx -> Spark AR Studio scaling issue for skeleton animations

I'm trying to create a character with skeleton animation in Blender to bring into Spark AR Studio. In Spark I want to use the baked animation. The .fbx brings the model and skeleton into Spark's scene just fine, until a new animation controller is selected via the object's inspector window and the animation is selected for use.
At that point, the Empty object named "Armature" is scaled to 100 instead of 1 and cannot be changed.
As a workaround, the Skeleton child object named "skeleton" can be scaled to 0.01. In Blender, I tried changing the scene's units and made sure the object's scales were all applied. Nothing is scaled to 100, everything is scaled to 1.
Since the object from the .fbx imports into Spark with correct scaling, I expect the animation to maintain that, but once the animation is selected the scale jumps from 1 to 100.
Put you animated object inside some nullObject and then scale down not animated but nullObject. Hope it is clear.

TMX: Only 1 tilset per layer is supported

i am take two layer Background and Cloud and in background i put background image and cloud layer i put cloud image and both TMX add to my project and when run i got error TMX: Only 1 tilset per layer is supported but only one layer use it run successfully..
Code:
CCTMXTiledMap *TiledFirst = [CCTMXTiledMap tiledMapWithTMXFile:#"BackgroundTiled.tmx"];
[self addChild:TiledFirst];
CCTMXTiledMap *Clould = [CCTMXTiledMap tiledMapWithTMXFile:#"Clould.tmx"];
[self addChild:Clould];
Cocos2d only supports one tileset per layer. This error occurs as soon as you add one tile (even a completely transparent one) from another tileset onto the same layer. Since there's no easy way to identify these tiles in Tiled and your map still being simple the easiest fix is to delete and re-add both layers, then make sure you add only tiles of one tileset to either layer.
PS: both KoboldTouch and Kobold Kit do not have this restriction.

Resizing CATiledLayer's Using Scale Transforms vs. Bounds Manipulation

I've got my layer hosted workspace working so that using CATiledLayers for hundreds of images works nicely when the workspace is zoomed out substantially. All the images use lower resolution representations, and my application is much more responsive when panning and zooming large numbers of images.
However, within my application I also provide the user the ability to resize layers with a resize handle. Before I converted image layers to use CATiledLayers I was doing layer resizes by manipulating the bounds of the image layer according to the resize delta (mouse drag), and it worked well. But now with CATiledLayers in place, this is causing CATiledLayers to get confused when I mix resizing of layers through bounds manipulation and zooming/unzooming the workspace through scale transforms.
Specifically, if I resize a CATiledLayer to half the width/height size (1/4 the area), the image inside it will suddenly scale to a further 1/2 the resized frame leaving 3/4 of the frame empty. This seems to be exactly when the inner CATiledLayer logic gets invoked to provide a lower resolution image representation. It works fine if I don't touch the resize handler and just zoom/unzoom the workspace.
Is there a way to make zooming/resizing play nice together with CATiledLayers, or am I going to have to convert my layer resize logic to use scale transforms instead of bounds manipulations?
I ended up solving this by converting my layer resize logic to use scale transforms by overriding the setBounds: method for my custom image layer class to scale it's containing CATiledLayer, and repositioning accordingly. Also it is important to make sure the CATiledLayer's autoresizingMask is set to kCALayerNotSizable since we are handling resizes manually in setBounds:.
Note: be sure to call the superclass's implementation of setBounds:.

CALayer renderInContext

I use
CATransform3D rotationAndPerspectiveTransform = CATransform3DIdentity;
rotationAndPerspectiveTransform.m34 = 1.0 / -500;
It's success, but I use "renderInContext:context" get CGImage from context, I found the image effect is not changed !
How can I get this effect image from CALayer?
My Original reply follows bellow. It was valid at the time I posted it, but Apple does not allow the usage of UIGetScreenImage anymore. To the best of my knowledge after the launch of iOS4 there's no alternative how to render layers with 3D transformations + your app will be rejected if you use UIGetScreenImage
From the iPhone developer docs on renderInContext :
Additionally, layers that use 3D
transforms are not rendered, nor are
layers that specify backgroundFilters,
filters, compositingFilter, or a mask
values.
So renderInContext is not the function you need to use to render a layer that has a 3D transformation applied.
Best you can do is call : UIGetScreenImage, which basically will give you a screenshot and you can then extract the image out of this screenshot.