coordinates

How to position a DIV in a specific coordinates?

冷暖自知 提交于 2019-11-27 10:14:15
I want to position a DIV in a specific coordinates ? How can I do that using Javascript ? Michael Berkowski Script its left and top properties as the number of pixels from the left edge and top edge respectively. It must have position: absolute; var d = document.getElementById('yourDivId'); d.style.position = "absolute"; d.style.left = x_pos+'px'; d.style.top = y_pos+'px'; Or do it as a function so you can attach it to an event like onmousedown function placeDiv(x_pos, y_pos) { var d = document.getElementById('yourDivId'); d.style.position = "absolute"; d.style.left = x_pos+'px'; d.style.top =

Sort latitude and longitude coordinates into clockwise ordered quadrilateral

笑着哭i 提交于 2019-11-27 10:09:38
问题 Problem Users can provide up to four latitude and longitude coordinates, in any order. They do so with Google Maps. Using Google's Polygon API (v3), the coordinates they select should highlight the selected area between the four coordinates. Question How do you sort an array of latitude and longitude coordinates in (counter-)clockwise order? Solutions and Searches StackOverflow Questions Drawing resizable (not intersecting) polygons How to sort points in a Google maps polygon so that lines do

How do i open Google Maps for directions using coordinates on the iphone

安稳与你 提交于 2019-11-27 09:37:33
问题 I am using UIMapView to display locations on the iPhone. I want to do a directions from current location to the location of interest, I don't think its possible using MapKit (but if it is please inform) So I will open either the Google Maps application or safari to display it. Can i do this by specifying co-ordinates from (current location) to co-ordinates (the location of interest) I have these longitudes and latitudes. Or do i have to use street addresses? If I do have to use street

How can I print a string to the console at specific coordinates in C++?

我们两清 提交于 2019-11-27 08:46:49
I'm trying to print characters in the console at specified coordinates. Up to now I have been using the very ugly printf("\033[%d;%dH%s\n", 2, 2, "str"); But I just had to ask whether C++ had any other way of doing this. The problem is not even that it's ugly, the problem comes up when I try to make myself a prettier function like so: void printToCoordinates(int x, int y, string text) { printf("\033[%d;%dH%s\n", x, x, text); } It doesn't work, even if I typecast to (char*) . Another problem is that I have to print out the \n for the page to be refreshed... I just don't enjoy using printf in

mismatch of event coordinates and view coordinates in Android?

試著忘記壹切 提交于 2019-11-27 08:39:15
问题 I've been trying to write a little application that recognizes custom events in Android: you hold your finger over a TextView for a certain length of time, and it changes color. I'm using the MotionEvent coordinates and checking if they are within the bounds of a particular TextView, which is within a table. private boolean checkBounds(TextView v, MotionEvent event) { int[] origin = new int[2]; v.getLocationOnScreen(origin); if ((event.getX() > origin[0]) && (event.getX() < (origin[0] + v

How to get correct coords(event.getX() / event.getY()) of Object with OnTouchListener

跟風遠走 提交于 2019-11-27 08:38:28
问题 I have this : and what i want exactly is that to show portion of Bitmap via coords (X,Y) of object with OnTouchListener(orange square with dot in center). So the problem is that i want to draw portion of image like it shows on image(Red square " Area that i want " to show). So in this case,excepted result is(portion of bitmap) : At current moment i'm doing like this: public boolean onTouch(View view, MotionEvent event) { switch (event.getAction()) { case MotionEvent.ACTION_MOVE: Bitmap

PHP Find Coordinates between two points

核能气质少年 提交于 2019-11-27 08:10:32
问题 simple question here. Lets say I have two points: point 1 x = 0 y = 0 point 2 x = 10 y = 10 How would i find out all the coordinates inbetween that programmatically, assuming there is a strait line between two points... so the above example would return: 0,0 1,1 2,2 3,3 ... 8,8 9,9 10,10 Thanks :) 回答1: thanks for all your help but non of the answers posted worked how i wanted it to. For example, lets say my points were: 0, 0 0, 10 There would only be a start and a finish coordinate... it

Convert Lat/Longs to X/Y Co-ordinates

旧街凉风 提交于 2019-11-27 08:06:18
I have the Lat/Long value of an small area in Melbourne; -37.803134,145.132377 and also a flat image of that,that I exported from openstreet map( Osmarender Image ). Image width : 1018 and Height:916 I would like to be able to convert, using C++, the Lat/Long to an X,Y coordinate where the point would reflect the location. I used various formula's that I found in web like one given below but nothing helps. var y = ((-1 * lat) + 90) * (MAP_HEIGHT / 180); var x = (lon + 180) * (MAP_WIDTH / 360); It would be of great help if any one give me clear explanation of how to do this . Any code would be

Apply Rotation to Cylinder based on Tube Ending Normal

让人想犯罪 __ 提交于 2019-11-27 07:56:16
问题 I am attempting to make a curved 3D arrow in three.js. To accomplish this task, I have created a Tube that follows a curved path and a Cylinder shaped as a cone (by setting radiusTop to be tiny). They currently look like so: I am attempting to position the Arrow Head (Cylinder shaped as a cone) at the end of the Tube like so: (Photoshopped) I am not terribly strong in math and pretty new to three.js. Could someone help me understand how to connect the two? Here is my current code: import T

Get the continent given the latitude and longitude [closed]

二次信任 提交于 2019-11-27 07:34:02
问题 I want to have certain code such that given the latitude and longitude as input, I want to get the continent which it belongs to? I know I can manually read the coordinates and then see that from the map. But is there an easier way to do it? 回答1: I've done this code just for getting the continent. It is not 100% exact, but pretty good for most territories. I did this to identify continents as asked by PVsyst, so I differenciate between Australia and Pacific, but this can be easily changed: If