<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.returnofreckoning.com/index.php?action=history&amp;feed=atom&amp;title=API%3AMapGetPointForCoordinates</id>
	<title>API:MapGetPointForCoordinates - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.returnofreckoning.com/index.php?action=history&amp;feed=atom&amp;title=API%3AMapGetPointForCoordinates"/>
	<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:MapGetPointForCoordinates&amp;action=history"/>
	<updated>2026-10-18T06:58:42Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://wiki.returnofreckoning.com/index.php?title=API:MapGetPointForCoordinates&amp;diff=30601&amp;oldid=prev</id>
		<title>Maintenance script: UI Lua API import (WAR 1.4.8)</title>
		<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:MapGetPointForCoordinates&amp;diff=30601&amp;oldid=prev"/>
		<updated>2026-10-16T19:47:11Z</updated>

		<summary type="html">&lt;p&gt;UI Lua API import (WAR 1.4.8)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{LuaApi|group=Map}}&lt;br /&gt;
Converts map coordinates into a position inside a map window, for placing markers on the map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pointX, pointY = MapGetPointForCoordinates(mapDisplayName, x, y)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Arguments ==&lt;br /&gt;
;mapDisplayName : &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; – Name of a MapDisplay window set up with [[API:CreateMapInstance|CreateMapInstance]].&lt;br /&gt;
;x, y : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – Coordinates on the map shown in the window, for example the &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt; fields from [[API:GetMapTextPoints|GetMapTextPoints]] or objective positions.&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
;pointX, pointY : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – Position inside the window, relative to its top-left corner. Nothing is returned if either value would be 0 or less.&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
* This is the reverse of [[API:MapGetCoordinatesForPoint|MapGetCoordinatesForPoint]].&lt;br /&gt;
* The stock UI passes the result straight to &amp;lt;code&amp;gt;WindowAddAnchor&amp;lt;/code&amp;gt; with a &amp;lt;code&amp;gt;&amp;quot;topleft&amp;quot;&amp;lt;/code&amp;gt; anchor on the map window.&lt;br /&gt;
* If the window does not exist or is not a MapDisplay, an error is logged, and the conversion is still attempted with the given name. With an empty name, the window check is skipped.&lt;br /&gt;
* If the client&amp;#039;s map data is not loaded, the function returns nothing.&lt;br /&gt;
* The function needs at least three arguments and only reads the last three.&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
These are written to the UI log; the call continues.&lt;br /&gt;
* &amp;lt;code&amp;gt;Error in function call &amp;#039;MapGetPointForCoordinates&amp;#039;: Display Window %s does not exist&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;Error in function call &amp;#039;MapGetPointForCoordinates&amp;#039;: Display Window %s is not a MapDisplay&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
From &amp;lt;code&amp;gt;default/ea_rvrtracker/source/rvrtracker.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
local x, y = MapGetPointForCoordinates(mapDisplay, objectivePoint.objPositionX, objectivePoint.objPositionY)&lt;br /&gt;
&lt;br /&gt;
CreateWindowFromTemplate(objectiveTimerWindow, &amp;quot;ObjectiveRvRTrackerTimer&amp;quot;, mapDisplay)&lt;br /&gt;
WindowAddAnchor(objectiveTimerWindow, &amp;quot;topleft&amp;quot;, mapDisplay, &amp;quot;topleft&amp;quot;, x, y)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[API:MapGetCoordinatesForPoint|MapGetCoordinatesForPoint]]&lt;br /&gt;
* [[API:GetMapTextPoints|GetMapTextPoints]]&lt;br /&gt;
* [[API:CreateMapInstance|CreateMapInstance]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>