Non-functioning example
When loading this example in compiled mode, the page displays the following:
ol3 proj4js demo
[object Object][object Object]
With `mode=RAW`, it does display some numbers, but I think we could better explain this functionality with a different sort of tutorial/example.
This commit is contained in:
@@ -1,13 +0,0 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="../css/ol.css" type="text/css">
|
||||
<script src="http://svn.osgeo.org/metacrs/proj4js/trunk/lib/proj4js-compressed.js" type="text/javascript"></script>
|
||||
<title>ol3 proj4js demo</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>ol3 proj4js demo</h1>
|
||||
<div id="output"></div>
|
||||
<script src="loader.js?id=proj4js" type="text/javascript"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,23 +0,0 @@
|
||||
goog.require('goog.dom');
|
||||
goog.require('ol.Coordinate');
|
||||
goog.require('ol.Projection');
|
||||
|
||||
|
||||
var outputElement = document.getElementById('output');
|
||||
|
||||
var point, transformedPoint;
|
||||
|
||||
point = new ol.Coordinate(-626172.13571216376, 6887893.4928337997);
|
||||
transformedPoint = ol.Projection.transformWithCodes(
|
||||
point, 'GOOGLE', 'WGS84');
|
||||
outputElement.appendChild(goog.dom.createTextNode(transformedPoint.toString()));
|
||||
|
||||
Proj4js.defs['EPSG:21781'] =
|
||||
'+proj=somerc +lat_0=46.95240555555556 +lon_0=7.439583333333333 +k_0=1 ' +
|
||||
'+x_0=600000 +y_0=200000 +ellps=bessel ' +
|
||||
'+towgs84=674.374,15.056,405.346,0,0,0,0 +units=m +no_defs';
|
||||
|
||||
point = new ol.Coordinate(7.439583333333333, 46.95240555555556);
|
||||
transformedPoint = ol.Projection.transformWithCodes(
|
||||
point, 'EPSG:4326', 'EPSG:21781');
|
||||
outputElement.appendChild(goog.dom.createTextNode(transformedPoint.toString()));
|
||||
Reference in New Issue
Block a user