How to draw rectangular box programmatically in javascript - dashcode

I am trying to draw the rectangular box on stacklayout's view programmatically (on runtime) using javascript so if any one has a solution for that please do tell me.
Thnx in advance
Parag

place a canvas part on the view within stacklayout then use canvas draw functions from js;
var c=document.getElementById("canvas");
var cxt=c.getContext("2d");
cxt.fillStyle="#FF0000";
cxt.fillRect(0,0,75,75);

Related

Bring tileLayer to front in Leaflet

Is it possible to display tileLayer on top of all other layers? This means that all other layers are displayed below the tileLayer.
Googled all day, but couldn't find definite yes or no.
Yes you can manipulate the order by simply adding this code:
var topPane = map._createPane('leaflet-top-pane', map.getPanes().mapPane);
topPane.appendChild(yourtileLayer.getContainer());
yourtileLayer.setZIndex(5);
Create a map pane on top of (with a higher z-index than) the standard tile pane, and position your tile layer in it.
There is an entire Lealfet tutorial on the issue.

Drawings not visible after removeLayer method : leaflet

Introduction
As i am working on application which uses leaflet api. Live Here
Where first user enter '1' as input to load the image on map.
Then user can draw different shapes(fences) using bottom-left buttons.
The 'eraser' button is suppose to remove all layers from map regarding CurrentFeatureGroup.
Problem
When we click on 'eraser' button, all shapes will be removed from map having currentfeaturegroup.
But after removing when we draw some other shapes, these shapes are invisible, although i have checked the function working properly.
I don't have idea how these shapes are now invisible.
Script(which responsible to remove layers)
L.easyButton('<img src="/delete.png">', function () {
map.removeLayer(currentFeatureGroup);
$('.leaflet-container').css('cursor', '');
}).addTo(map);
Please consider removeLayer, not clearLayer.If someone have any idea
about this problem please do help.Any kind of help or reference will
be appreciated, thanks for your time
If you completely remove the featurelayer from the map by using map.removeLayer(currentFeatureLayer) where do you expect that any new features you draw after that will be added to? If you want to remove all current features from the featurelayer you really should be using currentFeatureLayer.clearLayers() which will keep the featurelayer so that you can continue to add features afterwards.

How can I put a UI Image always on top in Unity 3D

I have noticed that in a canvas the elements are drawn from top to bottom so the image above is covered by the image below. The problem is that I want an ui image that is not the last sibling of the canvas to stay on top of all the others. How can I do?
I think you can try two ways.
First.
Use Transform.SetAsFirstSibling() to put the UI Component on top
Second.
Use CanvasGroup.sortingOrder to help your UI Component grouping.
Ref
http://docs.unity3d.com/Manual/class-CanvasGroup.html
http://docs.unity3d.com/ScriptReference/Transform.html
there are couple of functions you can use for setting orders
Transform.SetAsFirstSibling
Transform.SetAsLastSibling
Transform.SetSiblingIndex

Zoom map to display overlay in entire display area

I have added overlay on map. I don't know how to make map zoom upto certain level so overlay will display over entire display area. Here I need what should be zoom level so my overlay will display in entire display area or any other way to do it. For clarification I don't want to restrict the user to scroll outside of this overlay area.Any help will be appreciated. Thanks in Advance.
Please try the following code
[<mapView> setVisibleMapRect:[<overlayView> boundingMapRect]];
Thanks,

How to do circular scroll view?

I am doing an application in which i have to show a semi circle on which there should be different options in scroll view. That means on that image of semicircle i have to show scroll in circular way .
How can i do that??
Can anyone please guide me ?
You mean you'd need to rotate the contents inside the semi-circle like in a "wheel of fortune" kind of way?
I don't think you can do that with a regular UIScrollView, you'd have to handle the touches and do the rotation yourself.
I'd recommend you start by taking a look at the "Touches" code sample from the UIKit docs:
http://developer.apple.com/library/ios/#samplecode/Touches/Introduction/Intro.html#//apple_ref/doc/uid/DTS40007435