coordinates

MKPolygon to cover entire earth

旧街凉风 提交于 2019-12-25 14:09:18
问题 I'm trying to create an MKPolygon that will cover the entire earth, but can't find the right coordinates. my code looks like this: CLLocationCoordinate2D pathCoords[5]={ CLLocationCoordinate2DMake(0,-90), CLLocationCoordinate2DMake(0,90), CLLocationCoordinate2DMake(-180,90), CLLocationCoordinate2DMake(180,-90), CLLocationCoordinate2DMake(0,-90), }; MKPolygon *result = [MKPolygon polygonWithCoordinates:pathCoords count:5]; I've found this article that can help: http://www-01.ibm.com/support

Coordinates scale not correct when drawing a polyline on an View

▼魔方 西西 提交于 2019-12-25 09:44:43
问题 I want to draw a polyline on a view . I don't want to draw it on a MapView because I only want the polyline without any background. I have the polyline coordinates and I also have its bounds (northeast and southwest coordinates). The idea was to create a custom view and draw the path there. The problem I believe I'm having is with the scale. I can convert the LatLng coordinates to x and y coordinates but the polyline that is shown on the view is too small. The view is set with a 64dp width

How to get mouse position in float or double with exact resolution?

被刻印的时光 ゝ 提交于 2019-12-25 01:46:04
问题 I need to take the mouse click position in float or double, how can I do that?In mouse listener, I take the point like this, e.getPoint(); but Point object's x and y values are integer, I need position in float or double. Any help will be appreciated. Edit I need exact resolution. 回答1: getPoint() gives you integer values because that is the precision in which coordinates are specified. See http://java.sun.com/j2se/1.4.2/docs/api/java/awt/Point.html. Why do you need floating-point values? Edit

Coordinates transformation

ぐ巨炮叔叔 提交于 2019-12-24 20:33:08
问题 I have two 3D objects in space and i want to copy the points from one object to another. The problem is that these objects don't share a common coordinate system and i have to do coordinate transformations. I have the local transformation matrix for both objects and i have also access to the world transformation matrix. I know there's some calculations to be done using these transformation matrices but i don't know how. How can i transform one point in the first object so that it has the same

Convert from coordinates to pixels

旧巷老猫 提交于 2019-12-24 18:25:11
问题 I am implementing a rightclick context menu on my google v3 map and I need to get the pixel x and y to correctly position the menu. I get the lat and the lng, anyone have a nice solution to get the pixel x and y? Best Regards Henkemota 回答1: index=x+(y*height) x = index % width y = index / height 回答2: Correction to the above answer: index=x+(y*width) //(not y*height ... because you're taking one full horizontal line of pixels (e.g. 1280px) and multiplying that by the number of lines (y) down

jQuery - Access X and Y coordinates (custom event)

走远了吗. 提交于 2019-12-24 13:50:32
问题 I'm working on an image slide and making it touch enabled. I'm doing this by using a code snippet mentioned in this article: http://blog.safaribooksonline.com/2012/04/18/mapping-mouse-events-and-touch-events-onto-a-single-event/ The author mentions that by using his code, which triggers a normalizing event on touch events, the access of X and Y coordinates is much easier. And that's exactly what I found difficult. I can't seem to access these values at all. I've tried everything I can come up

Sort Coordinates from top left to bottom right

本小妞迷上赌 提交于 2019-12-24 12:11:53
问题 I extracted 110 coordinates from contours of a 10x11 LED-Array using C++ and OpenCV and stored them in a vector. Now I want to sort them from top left to bottom right to detect if a LED in a certain row and column is on. I presorted the coordinates by y-position to make sure that the first 10 coordinates in the vector representing the first LED row in my Image. vector<Point2f> centers; bool compareY(Point2f p1, Point2f p2){ if(p1.y < p2.y) return true; if(p1.y > p2.y) return false; } sort

selected text and xy coordinates

自古美人都是妖i 提交于 2019-12-24 09:37:07
问题 how to get a selected text and xy coordinates of the word in the same time?? 回答1: Just googled it: var txt = ""; if (window.getSelection) { txt = window.getSelection(); } else if (document.getSelection) { // FireFox txt = document.getSelection(); } else if (document.selection) { // IE 6/7 txt = document.selection.createRange().text; } txt = txt.toString() There is no simple way to get X/Y coordinates of the selected text. Because it dependes on its container position and size, text font, text

Coordinates of last element in ScrollView

ε祈祈猫儿з 提交于 2019-12-24 07:59:29
问题 I have this scroll view with many elements inside for which the height is variable. I want to know if there is a way to know the maxY of the last element in the scrollview, without adding up the height of all the elements in the scrollview. I tried lastViewInScrollView.frame.maxY and it was not right. 回答1: It is totally mathematics, as you said you dont want to add all the element before the last element, thats OK, now work with the end of the scrollview. As per the apple documentation (https

minecraft: How to get coordinates of blocks inside selection

。_饼干妹妹 提交于 2019-12-24 07:38:42
问题 For a Loot Plugin i need all the coordinates of chests in my prebuilt world. To add them to the plugins config. I am not programming the plugin, i am just using it, i just need a way to get multiple coordinates for specific blocks in a world. OR If it is possible to use worldedit and replace chests with chests that have nbt tags i can completely skip the plugin part and use the vanilla loot tables. But i haven't yet found a way to setblocks with nbt data using worldedit. I was thinking about