Freeze map on one scale - openlayers-3

I need to fix the scale of the map, but zoom to the image. ImageWMS, TileImage, TileArcGISRest, Vector are used to display the image.
I tried to block requests to make sure that I can zoom to the image. It works, but the image only covers the initial extent.
Can I customize the desired behavior somehow? Can I request at once all the necessary extent (off the map) and work only with it?

Related

How to disable showing a layer while changing resolution (e.g. zoom animation) in OL3?

While changing zoom factors for a map, its layers appear stretched with the latest available data, i.e. lower resolution tiles, images, etc.
Is it possible to disable this effect? I would like to have the layer shown only after its "loadend", but the layer's data will be loaded only if it's visible...
I've digged into the rendering workflow, but it's nto easy to find a consistent way to obtain it for all the renderers.

How can I show image in laptop screen, with appropriate image rotation and perspective?

I have been searching from last two days on internet, I have checked many source codes on net but none of them has provided the result I want.
The image rotation would have perspective but still there would be no changes in the heights of both left and right sides of an image.
I want to set image inside the laptop screen
Please help me out, Thanks.
So you want to 2D pespective drawing of a laptop screen (on an iOS device?) and put a 2D image on that screen, but with the image transformed so its perspective looks correct on the laptop screen, right?
What you need to do is to add an image view on top of your laptop image view. Lets call it laptopScreenImageView.
Then apply a CATransform3D to that the laptopScreenImageView's layer.
The trick to get 3D perspective out of a CALayer is to modify the .m34 value of the transform. Typically you set the .m34 value to a very small negative number, somewhere around -1/200 to -1/500 (the denominator in the fraction is the z coordinate of the "eye position" for viewing the perspective image, in pixels, or how many pixels "above" the image the viewer's eye should seem to be. I don't fully understand it, to be honest. I fiddle with the .m34 value until I get something that looks right.)
Alternately you could try adding a CATransformLayer to your laptop image view's layer, and then adding a CALayer containing your image as a sublayer of the CATransformLayer. I haven't used CATransformLayers before, but the docs say they are supposed to support layers with 3D perspective, giving you the same effect as modifying the .m34 component of a layer's transform.

MapBox Marker Size on Zoom (ios sdk)

I'm trying to change the size of the marker image during a zoom event, so the image scales nicely while pinching/zooming.
I can't find anywhere how to do this, the closest I have come is to resize the marker image after the zoom event is completed (when the zoom level changes)
It would look a lot nicer if it would resize during the zoom event instead of after.
Any ideas?
Look into using RMMapLayer directly (RMMarker's superclass) which should scale when zoomed. RMShape and RMCircle are also a good, albeit not directly related, models for this since they represent shapes that "stick" to the map instead of points that don't scale. But the short answer is there is not built-in functionality for this.

Drawing World Map - Performance & Interaction - iOS

I’d like to use a Shapefile to generate an interactive world map. I was able to import the data and use CG Paths to draw the map into one large view.
The map needs to support panning, zooming and touch interaction. For that, I've created a UIScrollView and placed the MapView (large view with all of the countries drawn) into it.
I need to improve two aspects of it:
Performance / rendering
I have drawn the map much larger than the screen size, in order to make it look reasonable when I zoom in. There are a few problems with this. First, when I'm zoomed out, I need the border stroke/line to be wider so they are visible. When I zoom in, I'd like the stroke to be a thinner. Also, when I zoom in, I can still see that the map is a blurry. I don't want to increase the view size too much.
How can I make the map look crisp when I'm zoomed in? I attempted to redraw the map on zoom in, but it takes far too long. Can I somehow only re render onscreen stuff?
Touch Interaction
I need to be able to have a touch event for every different country.
Possible approach?
I was thinking of trying to separate every country onto it’s own view. That should make touches easy to handle. Then I’m thinking I can possibly redraw the appropriate views that are on screen/zoomed to.
I've played with an app that does something similar ("World Maps"), and I can see that when you pan or zoom, the map is blurry for a second but then becomes clear. What is going on there?
use mapkit and provide custom tiles. dont reinvent the wheel and try to write yet another map framework
I think that you have to create different scaled area image from the big map image. how to say... imagine the google map, how it works... I think that provide many different zoom factor image for every area of the world... then merged display on the screen while user need show it ...
use code implemented the map effect is impossible on current iPhone device, out of the ability of the iOS device

OpenGL ImageViewer

I have been trying to make an ImageViewer in OpenGL. But I don't know how to hide specific parts of my vectors/textures in OpenGL.
The ImageViewer should be an exact copy of an UIScrollView with paging enabled, where the images fill the whole screen.
The neat thing in UIScrollView is that you can set the actual frame of the UIScrollView, and set the content size, so when the image gets slided out of the frame, you won't be able to see the image anymore.
I need some guidelines so I can continue researching what to do.
Maybe you can setup your fragment shader to make pixels invisible when they are out of range.
You know the position of the 4 vertices (top-left,top-right,bottom-left,bottom-right) and the position of the texture. You can then upload a uniform vec4 to the fragment shader containing the minimum and maximum x and y sizes of the window. You then calculate if a pixel is inside or outside that area. If inside: actual color, if outside: gl_fragcolor=vec4(1,1,1,0);
Is this any help?
I found a solution myself.
I put an UIScrollView that fills the whole screen, and use that offset to move the texture coordinates.
I don't know if this is the optimal solution, but I don't have any performance problems etc. So it is good enough for now.
If you have better solutions, feel free to suggest them.

Resources