you should acquire map objects.getPixelFromCoordinate is a method that map
objects hold.var pixel =
map.getPixelFromCoordinate(coordinateFirstClub);console.log(pixel); // Return
nullmy pleasure ----- 原文 ----- 发件人: openlayers-users-requ...@lists.osgeo.org 主
题: Users Digest, Vol 105, Issue 1时 间: 2015年6月3日 上午3:01:03Send Users mailing
list submissions to openlayers-users@lists.osgeo.orgTo subscribe or
unsubscribe via the World Wide Web, visit
http://lists.osgeo.org/mailman/listinfo/openlayers-usersor, via email, send a
message with subject or body 'help' to
openlayers-users-request@lists.osgeo.orgYou can reach the person managing the
list at openlayers-users-owner@lists.osgeo.orgWhen replying, please edit your
Subject line so it is more specificthan "Re: Contents of Users
digest..."Today's Topics: 1. getPixelFromCoordinate method in OL3?
(pascal)----------------------------------------------------------------------Message:
1Date: Tue, 2 Jun 2015 05:59:05 -0700 (PDT)From: pascal
<pascal2...@gmail.com>To: openlayers-users@lists.osgeo.orgSubject:
[OpenLayers-Users] getPixelFromCoordinate method in OL3?Message-ID:
<1433249945244-5208665.p...@n6.nabble.com>Content-Type: text/plain;
charset=us-asciiHi, I'm trying to retrieve pixel coordinates from long/lat
coordinate to draw ina canvas element using this way:var geometryFirstClub =
clubFeatures[0].getGeometry(); // clubFeatures is anarray of circlesvar
coordinateFirstClub = geometryFirstClub.getCenter();
console.log(coordinateFirstClub); // Return Array [ 7, 43.33 ] var pixel =
getPixelFromCoordinate(coordinateFirstClub);console.log(pixel); // Return
nullSo, I don't understand why I have "null" in console.log response.What's
wrong?Thanks a lot, Pascal.--View this message in context:
http://osgeo-org.1560.x6.nabble.com/getPixelFromCoordinate-method-in-OL3-tp5208665.htmlSent
from the OpenLayers Users mailing list archive at
Nabble.com.------------------------------_______________________________________________Users
mailing
listUsers@lists.osgeo.orghttp://lists.osgeo.org/mailman/listinfo/openlayers-usersEnd
of Users Digest, Vol 105, Issue 1*************************************
_______________________________________________
Users mailing list
us...@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/openlayers-users