3 <html lang="en" class="no-js">
7 <title>toPixel | geomap</title>
8 <meta name="description" content="geomap toPixel method">
9 <meta name="author" content="Ryan Westphal">
11 <meta name="viewport" content="width=device-width, initial-scale=1.0">
13 <link rel="stylesheet" href="../css/style.css?v=2">
14 <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css" />
19 <div id="toPixel" data-role="page">
20 <div data-role="header" data-theme="e">
24 <div data-role="content">
28 <td>Array (<a href="http://geojson.org/geojson-spec.html#positions" rel="external">GeoJSON positions</a>)</td>
32 <td>.geomap( "toPixel", Array mapPositions )</td>
36 <td><pre><code>var pixelPos = $("#map").geomap( "toPixel", [ -71.098709, 42.330322 ] )
37 var pixelPositions = $("#map").geomap( "toPixel", [ [ -71.098709, 42.330322 ], [ -71.072617, 42.351608 ] ] )</code></pre></td>
40 <p>The toPixel method takes a single GeoJSON position (Point.coordinates), an array of GeoJSON positions (MultiPoint.coordinates or LineString.coordinates), an array of arrays of positions (MultiLineString.coordinates or Polygon.coordinates) or an array of arrays of arrays of positions (MultiPolygon.coordinates). It returns the pixel coordinates for all of the map positions.</p>
41 <p>You can pass geodetic (lon, lat) or projected coordinates regardless of how you last set the bbox or center options.</p>
43 </div> <!-- end of #container -->
45 <script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
46 <script src="http://code.jquerygeo.com/jquery.geo-1.0a4.min.js"></script>
47 <script src="../js/script.js"></script>
48 <script src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js"></script>