<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />you should acquire map objects.<br>getPixelFromCoordinate is a method that map objects hold.<br><br>var pixel = map.getPixelFromCoor<p><wbr>dinate(coordinateFirstClub);<br>console.log(pixel); // Return null</p><br><br>my pleasure<br><div id="addMailSign"><span> </span></div><div style="background-color:#fff" id="mailcontent"><br><blockquote dir="ltr" style="border-left:2px solid #000000;margin-left:10px;margin-right:0px;padding-left:5px;padding-right:0px;font-family:宋体;font-style:normal;font-variant:normal;font-weight:normal;font-size: 9pt;line-height:normal;font-size-adjust:none;font-stretch:normal;"><div style="font-family: 宋体; font-style: normal; font-variant: normal; font-weight: normal; font-size: 9pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">----- 原文 ----- </div><br><b>发件人:</b> <a hidefocus="true" xhref="mailto:openlayers-users-request@lists.osgeo.org" mce_href="mailto:openlayers-users-request@lists.osgeo.org">openlayers-users-request@lists.osgeo.org</a> <br><b>主 题:</b> Users Digest, Vol 105, Issue 1<br><b>时 间:</b> 2015年6月3日  上午3:01:03<br><br><p>Send Users mailing list submissions to<br>  openlayers-users@lists.osgeo.org<br><br>To subscribe or unsubscribe via the World Wide Web, visit<br> http://lists.osgeo.org/mailm<wbr>an/listinfo/openlayers-users<br>or, via email, send a message with subject or body 'help' to<br>     openlayers-users-request@lis<wbr>ts.osgeo.org<br><br>You can reach the person managing the list at<br>  openlayers-users-owner@lists.osgeo.org<br><br>When replying, please edit your Subject line so it is more specific<br>than "Re: Contents of Users digest..."<br><br><br>Today's Topics:<br><br>   1. getPixelFromCoordinate method in OL3? (pascal)<br><br><br>-----------------------------<wbr>------------------------------<wbr>-----------<br><br>Message: 1<br>Date: Tue, 2 Jun 2015 05:59:05 -0700 (PDT)<br>From: pascal <pascal2833@gmail.com><br>To: openlayers-users@lists.osgeo.org<br>Subject: [OpenLayers-Users] getPixelFromCoordinate method in OL3?<br>Message-ID: <1433249945244-5208665.post@n6.nabble.com><br>Content-Type: text/plain; charset=us-ascii<br><br>Hi, <br><br>I'm trying to retrieve pixel coordinates from long/lat coordinate to draw in<br>a canvas element using this way:<br>var geometryFirstClub = clubFeatures[0].getGeometry(); // clubFeatures is an<br>array of circles<br>var coordinateFirstClub = geometryFirstClub.getCenter(); <br> console.log(coordinateFirstClub); // Return Array [ 7, 43.33 ]<br> var pixel = getPixelFromCoor<wbr>dinate(coordinateFirstClub);<br>console.log(pixel); // Return null<br><br>So, I don't understand why I have "null" in console.log response.<br>What's wrong?<br><br>Thanks a lot, <br><br>Pascal.<br><br><br><br>--<br>View this message in context:<wbr> http://osgeo-org.1560.x6.nabb<wbr>le.com/getPixelFromCoordinate-<wbr>method-in-OL3-tp5208665.html<br>Sent from the OpenLayers Users mailing list archive at Nabble.com.<br><br><br>------------------------------<br><br>_____________________________<wbr>__________________<br>Users mailing list<br>Users@lists.osgeo.org<br>http://lists.osgeo.org/mailma<wbr>n/listinfo/openlayers-users<br><br>End of Users Digest, Vol 105, Issue 1<br>*****************************<wbr>********<br></p></blockquote></div><br /><br /><br />