How to implement a grid overlay on static image with React Native - css

I am trying to create a coordinate system for my localisation application. I need a grid of squares that can be individually manipulated by their position. This grid overlay will then be layered on top of a static image.
For example box (1,0) will manipulate the second row first column box.
Here is an example:
grid overlay on image example
Any ideas on how to achieve this? Any advice is greatly appreciated.

Related

Zoom & crop an image and draw an svg-square on top (in angular)

"A stackblitz is worth a thousand words": https://stackblitz.com/edit/angular-zoom-crop-marker
Basically what I'm trying to do is to have a square drawn above a certain position in an image (<img>), and have that dynamically adjust to the image while being zoomed in / out and cropped. The stackblitz link has 3 views, the basic view which is a plain image, a zoomable view (which I got working as well) and a view where the imaged is "zoomed in and cropped" while being zoomable - This is where I need your help.
Should I crop using object-fit in some way? Is it better if I use a canvas to handle this? I've been at this for a whole day I and I feel my css knowledge is too limited to pull this of.
Bonus question: How would I go about to have the zoom-in zoom-out buttons add/remove one image per row using only css flex-box? (ie: not statically adding x pixles in height and width, but rather increase or decrease the size of each image so that another image is removed or added (per row) while always filling up all the available space)
Thank you in advance!
Managed to solve it myself. stackblitz updated with a working solution.

Clickable Map Grid Overlay

I am trying to create a map grid using Google maps. I have a fixed border frame and need to create an overlay on top, similar to this and this example. However, I also need to be able to hover over map tiles using the mouse cursor and change the hue/saturation of the overlay elements accordingly. Each element in the grid will have an onClick() event associated with it.
After some research I found libraries that can be used to draw a grid such as OSMatrix.I also noticed that one of the d3.js examples is somewhat similar to what I am aiming to achieve. The question is, how can I add the visualization as an overlay on top of a map and is it possible to accomplish with API v3 and JavaScript?

Designing linear layout

I am trying to design a layout which is containing 2 textView at the rightside of imageView.
I know that it is easy to design it with Relative layout.
But i want to design it using linear layout.
Please provide some hints or code to do this.
Thank you in advance!
Hint: You can use LinearLayouts in nested way, one inside the other and so on.
Refer to the following image from Developer site
From the image it is clear that for your case you need to create a linear layout inside that create a imageView and a LinearLayout(called linearLayout2). Now Inside linearLayout2 create two textViews.
Visualize the Linear layout with orientation set to horizontal and set layout_weight to each control. A layout weight of 0.5 means a control will take up the left half of the linear layout (50%).

Flex charting - Fixing the background grid and multi-line plotting

I have two requirements for a flex charting component:
The grid lines should always remain fixed to a scaling I define using an array of data. Something like a graph paper sheet.
Plot multiple line series data over this grid.
How does one get complete control over the background grid lines? I have tried a combination of annotation elements and setting the linechart background elements. If I get the grid right, I can't plot over it (Probably due to the scale). Can anyone share how would one go about designing a graphpaper like interface for linecharts in flex/actionscript?

Place grid over map using CSS?

I have a world map image. I would like to place a SQUARE GRID over the entire map. I would like each square (cell grid) to change via mouseover with a border color change and background color change.
The grid needs to be layered over the map, transparent except the borders (which is the grid).
Can I achieve this using CSS or there a better way to do this?
Many thanks.
Erik
I'd suggest using a CSS grid framework as an easy way to produce the grid layout. I'd go for this one as you can easily use create a grid with 0px gutters.
You will need to modify the CSS to make the grid absolute positioned so it sits over the top of your map.
Each element in the grid is a DIV so you can easily attach Javascript events to each one to allow users to control the map. If it's a simple colour change on hover then just use css.
You can make the grid transparent using css too: http://css-tricks.com/css-transparency-settings-for-all-broswers/

Resources