Using Proj4js with OpenLayers to transform lat lng from 4326 to 27700 but coming out unchangedUsing Proj4js in Openlayers - Proj4js is not definedOpenLayers/proj4js and the EPSG:27700 (UK) ProjectionOpenLayers transform EPSG 27700 coordinate to Google 900913Problems with features, popups and strategy with OpenLayersOpenLayers.Bounds transform not working as expectedGet Lat & Lng from GeoDjango OSMGeoAdminOpenlayers Transform not transforming a point from EPSG 27700 to EPSG 4326Using Proj4js in Openlayers - Proj4js is not definedUsing OSGB (ESPG: 27700) projection in Openlayers with MousePositionOpenLayers and proj4js.defs() - why does one custom projection work and not the other?Problem on changing the EPSG:3376 to EPSG:4326 using Proj4js

What is the maximum number of net attacks that one can make in a round?

How does an ordinary object become radioactive?

How come the nude protesters were not arrested?

Meaning of 'lose their grip on the groins of their followers'

How can this tool find out registered domains from an IP?

Wooden cooking layout

Cascading Switches. Will it affect performance?

How do I prevent employees from either switching to competitors or opening their own business?

SQL counting distinct over partition

How did old MS-DOS games utilize various graphic cards?

How to handle self harm scars on the arm in work environment?

Are there any important biographies of nobodies?

How can I end combat quickly when the outcome is inevitable?

Soft question: Examples where lack of mathematical rigour cause security breaches?

Check if three arrays contains the same element

When would it be advantageous not apply Training Ground's cost reduction?

How to hide an urban landmark?

Is White controlling this game?

What speaks against investing in precious metals?

Does the Long March-11 increase its thrust after clearing the launch tower?

Playing a Character as Unobtrusive and Subservient, Yet Not Passive

Why didn't Voldemort recognize that Dumbledore was affected by his curse?

Should I give professor gift at the beginning of my PhD?

How do governments keep track of their issued currency?



Using Proj4js with OpenLayers to transform lat lng from 4326 to 27700 but coming out unchanged


Using Proj4js in Openlayers - Proj4js is not definedOpenLayers/proj4js and the EPSG:27700 (UK) ProjectionOpenLayers transform EPSG 27700 coordinate to Google 900913Problems with features, popups and strategy with OpenLayersOpenLayers.Bounds transform not working as expectedGet Lat & Lng from GeoDjango OSMGeoAdminOpenlayers Transform not transforming a point from EPSG 27700 to EPSG 4326Using Proj4js in Openlayers - Proj4js is not definedUsing OSGB (ESPG: 27700) projection in Openlayers with MousePositionOpenLayers and proj4js.defs() - why does one custom projection work and not the other?Problem on changing the EPSG:3376 to EPSG:4326 using Proj4js






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








2















Using Proj4js to transform lat lng from 4326 to 27700 but coming out unchanged. I am using OpenLayers 2.12 (OS API Leisure map) EPSG 27700, Proj4js (CDN)



I have added the definition to proj4



epsg4326 = new OpenLayers.Projection("EPSG:4326"); //WGS 1984 projection 
// To
proj4.defs("EPSG:27700","+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +towgs84=446.448,-125.157,542.06,0.15,0.247,0.842,-20.489 +units=m +no_defs");
EPSG27700 = new OpenLayers.Projection("EPSG:27700");


var lonLat = new OpenLayers.LonLat(-0.1279688, 51.5077286).transform(epsg4326, EPSG27700);
console.log(lonLat);


lonLat is coming out as  lon: -0.1279688, lat: 51.5077286 so unchanged.



I think I'm missing a trick.










share|improve this question






























    2















    Using Proj4js to transform lat lng from 4326 to 27700 but coming out unchanged. I am using OpenLayers 2.12 (OS API Leisure map) EPSG 27700, Proj4js (CDN)



    I have added the definition to proj4



    epsg4326 = new OpenLayers.Projection("EPSG:4326"); //WGS 1984 projection 
    // To
    proj4.defs("EPSG:27700","+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +towgs84=446.448,-125.157,542.06,0.15,0.247,0.842,-20.489 +units=m +no_defs");
    EPSG27700 = new OpenLayers.Projection("EPSG:27700");


    var lonLat = new OpenLayers.LonLat(-0.1279688, 51.5077286).transform(epsg4326, EPSG27700);
    console.log(lonLat);


    lonLat is coming out as  lon: -0.1279688, lat: 51.5077286 so unchanged.



    I think I'm missing a trick.










    share|improve this question


























      2












      2








      2








      Using Proj4js to transform lat lng from 4326 to 27700 but coming out unchanged. I am using OpenLayers 2.12 (OS API Leisure map) EPSG 27700, Proj4js (CDN)



      I have added the definition to proj4



      epsg4326 = new OpenLayers.Projection("EPSG:4326"); //WGS 1984 projection 
      // To
      proj4.defs("EPSG:27700","+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +towgs84=446.448,-125.157,542.06,0.15,0.247,0.842,-20.489 +units=m +no_defs");
      EPSG27700 = new OpenLayers.Projection("EPSG:27700");


      var lonLat = new OpenLayers.LonLat(-0.1279688, 51.5077286).transform(epsg4326, EPSG27700);
      console.log(lonLat);


      lonLat is coming out as  lon: -0.1279688, lat: 51.5077286 so unchanged.



      I think I'm missing a trick.










      share|improve this question
















      Using Proj4js to transform lat lng from 4326 to 27700 but coming out unchanged. I am using OpenLayers 2.12 (OS API Leisure map) EPSG 27700, Proj4js (CDN)



      I have added the definition to proj4



      epsg4326 = new OpenLayers.Projection("EPSG:4326"); //WGS 1984 projection 
      // To
      proj4.defs("EPSG:27700","+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +towgs84=446.448,-125.157,542.06,0.15,0.247,0.842,-20.489 +units=m +no_defs");
      EPSG27700 = new OpenLayers.Projection("EPSG:27700");


      var lonLat = new OpenLayers.LonLat(-0.1279688, 51.5077286).transform(epsg4326, EPSG27700);
      console.log(lonLat);


      lonLat is coming out as  lon: -0.1279688, lat: 51.5077286 so unchanged.



      I think I'm missing a trick.







      openlayers-2 proj4js






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited May 22 at 12:37









      Ian Turton

      51.3k548121




      51.3k548121










      asked May 22 at 12:24









      Simon JeffsSimon Jeffs

      111




      111




















          3 Answers
          3






          active

          oldest

          votes


















          2














          transform converts the point in place so no new point is returned. See the documentation:




          Transform the LonLat object from source to dest. This transformation is in place: if you want a new lonlat, use .clone() first.




          So you want something like:



           var lonLat = new OpenLayers.LonLat(-0.1279688, 51.5077286);
          lonLat.transform(epsg4326, EPSG27700);
          console.log(lonLat);





          share|improve this answer























          • The transformation is in place, but it still returns the result, for example in map.setCenter(new OpenLayers.LonLat(-0.1279688, 51.5077286).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()));

            – Mike
            May 22 at 13:06











          • Thanks for the tip, however both still output the original lat/lng

            – Simon Jeffs
            May 22 at 13:28


















          1














          OpenLayers 2 uses an earlier proj4 (version 1.1.0) syntax:



          Proj4js.defs["EPSG:27700"] = "+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +datum=OSGB36 +units=m +no_defs ";


          or with proj4 version 2:



          <!doctype html>
          <html lang="en">
          <head>
          <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.5.0/proj4.js"></script>
          <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/openlayers/2.12/OpenLayers.min.js"></script>
          </head>
          <body>
          <script type="text/javascript">

          window.Proj4js =
          Proj: function(code)
          return proj4(Proj4js.defs[code]);
          ,
          defs: proj4.defs,
          transform: proj4
          ;

          proj4.defs("EPSG:27700","+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +towgs84=446.448,-125.157,542.06,0.15,0.247,0.842,-20.489 +units=m +no_defs");

          var epsg4326 = new OpenLayers.Projection("EPSG:4326");
          var EPSG27700 = new OpenLayers.Projection("EPSG:27700");

          var lonLat = new OpenLayers.LonLat(-0.1279688, 51.5077286).transform(epsg4326, EPSG27700);
          alert(lonLat.lon + ' ' + lonLat.lat);

          </script>
          </body>
          </html>





          share|improve this answer

























          • If you are using the OS API some transforms are built in openspace.ordnancesurvey.co.uk/docs/4.0.0/files/OpenSpace/…

            – Mike
            May 22 at 12:58











          • We were using the openspace api but are migrating to the OS API apidocs.os.uk/docs/os-maps-overview so have to remove the OpenSpace reference

            – Simon Jeffs
            May 22 at 13:06











          • see also gis.stackexchange.com/questions/120021/…

            – Mike
            May 22 at 13:32


















          0














          Ok, I figured out my issue. I looked at the post Mike shared Using Proj4js in Openlayers - Proj4js is not defined and tried the example code in my project which still failed. That narrowed it down to the js references. So I copied the references and et voila; success!



          My references:
          https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.5.0/proj4-src.js
          https://cdnjs.cloudflare.com/ajax/libs/openlayers/2.12/OpenLayers.min.js



          Changed to:
          https://cdnjs.cloudflare.com/ajax/libs/proj4js/1.1.0/proj4js-compressed.min.js
          https://cdnjs.cloudflare.com/ajax/libs/openlayers/2.13.1/OpenLayers.js



          Note that it worked with both versions of OpenLayers js file but not when using 2.5.0.



          Thanks to Ian and Mike for helping!






          share|improve this answer























          • 2..5.0 is working for me. I've added the code to my answer.

            – Mike
            May 22 at 16:23











          • Working with mine now too. Thanks Mike!

            – Simon Jeffs
            May 23 at 10:46











          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "79"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f323552%2fusing-proj4js-with-openlayers-to-transform-lat-lng-from-4326-to-27700-but-coming%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          3 Answers
          3






          active

          oldest

          votes








          3 Answers
          3






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          2














          transform converts the point in place so no new point is returned. See the documentation:




          Transform the LonLat object from source to dest. This transformation is in place: if you want a new lonlat, use .clone() first.




          So you want something like:



           var lonLat = new OpenLayers.LonLat(-0.1279688, 51.5077286);
          lonLat.transform(epsg4326, EPSG27700);
          console.log(lonLat);





          share|improve this answer























          • The transformation is in place, but it still returns the result, for example in map.setCenter(new OpenLayers.LonLat(-0.1279688, 51.5077286).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()));

            – Mike
            May 22 at 13:06











          • Thanks for the tip, however both still output the original lat/lng

            – Simon Jeffs
            May 22 at 13:28















          2














          transform converts the point in place so no new point is returned. See the documentation:




          Transform the LonLat object from source to dest. This transformation is in place: if you want a new lonlat, use .clone() first.




          So you want something like:



           var lonLat = new OpenLayers.LonLat(-0.1279688, 51.5077286);
          lonLat.transform(epsg4326, EPSG27700);
          console.log(lonLat);





          share|improve this answer























          • The transformation is in place, but it still returns the result, for example in map.setCenter(new OpenLayers.LonLat(-0.1279688, 51.5077286).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()));

            – Mike
            May 22 at 13:06











          • Thanks for the tip, however both still output the original lat/lng

            – Simon Jeffs
            May 22 at 13:28













          2












          2








          2







          transform converts the point in place so no new point is returned. See the documentation:




          Transform the LonLat object from source to dest. This transformation is in place: if you want a new lonlat, use .clone() first.




          So you want something like:



           var lonLat = new OpenLayers.LonLat(-0.1279688, 51.5077286);
          lonLat.transform(epsg4326, EPSG27700);
          console.log(lonLat);





          share|improve this answer













          transform converts the point in place so no new point is returned. See the documentation:




          Transform the LonLat object from source to dest. This transformation is in place: if you want a new lonlat, use .clone() first.




          So you want something like:



           var lonLat = new OpenLayers.LonLat(-0.1279688, 51.5077286);
          lonLat.transform(epsg4326, EPSG27700);
          console.log(lonLat);






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered May 22 at 12:36









          Ian TurtonIan Turton

          51.3k548121




          51.3k548121












          • The transformation is in place, but it still returns the result, for example in map.setCenter(new OpenLayers.LonLat(-0.1279688, 51.5077286).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()));

            – Mike
            May 22 at 13:06











          • Thanks for the tip, however both still output the original lat/lng

            – Simon Jeffs
            May 22 at 13:28

















          • The transformation is in place, but it still returns the result, for example in map.setCenter(new OpenLayers.LonLat(-0.1279688, 51.5077286).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()));

            – Mike
            May 22 at 13:06











          • Thanks for the tip, however both still output the original lat/lng

            – Simon Jeffs
            May 22 at 13:28
















          The transformation is in place, but it still returns the result, for example in map.setCenter(new OpenLayers.LonLat(-0.1279688, 51.5077286).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()));

          – Mike
          May 22 at 13:06





          The transformation is in place, but it still returns the result, for example in map.setCenter(new OpenLayers.LonLat(-0.1279688, 51.5077286).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()));

          – Mike
          May 22 at 13:06













          Thanks for the tip, however both still output the original lat/lng

          – Simon Jeffs
          May 22 at 13:28





          Thanks for the tip, however both still output the original lat/lng

          – Simon Jeffs
          May 22 at 13:28













          1














          OpenLayers 2 uses an earlier proj4 (version 1.1.0) syntax:



          Proj4js.defs["EPSG:27700"] = "+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +datum=OSGB36 +units=m +no_defs ";


          or with proj4 version 2:



          <!doctype html>
          <html lang="en">
          <head>
          <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.5.0/proj4.js"></script>
          <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/openlayers/2.12/OpenLayers.min.js"></script>
          </head>
          <body>
          <script type="text/javascript">

          window.Proj4js =
          Proj: function(code)
          return proj4(Proj4js.defs[code]);
          ,
          defs: proj4.defs,
          transform: proj4
          ;

          proj4.defs("EPSG:27700","+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +towgs84=446.448,-125.157,542.06,0.15,0.247,0.842,-20.489 +units=m +no_defs");

          var epsg4326 = new OpenLayers.Projection("EPSG:4326");
          var EPSG27700 = new OpenLayers.Projection("EPSG:27700");

          var lonLat = new OpenLayers.LonLat(-0.1279688, 51.5077286).transform(epsg4326, EPSG27700);
          alert(lonLat.lon + ' ' + lonLat.lat);

          </script>
          </body>
          </html>





          share|improve this answer

























          • If you are using the OS API some transforms are built in openspace.ordnancesurvey.co.uk/docs/4.0.0/files/OpenSpace/…

            – Mike
            May 22 at 12:58











          • We were using the openspace api but are migrating to the OS API apidocs.os.uk/docs/os-maps-overview so have to remove the OpenSpace reference

            – Simon Jeffs
            May 22 at 13:06











          • see also gis.stackexchange.com/questions/120021/…

            – Mike
            May 22 at 13:32















          1














          OpenLayers 2 uses an earlier proj4 (version 1.1.0) syntax:



          Proj4js.defs["EPSG:27700"] = "+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +datum=OSGB36 +units=m +no_defs ";


          or with proj4 version 2:



          <!doctype html>
          <html lang="en">
          <head>
          <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.5.0/proj4.js"></script>
          <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/openlayers/2.12/OpenLayers.min.js"></script>
          </head>
          <body>
          <script type="text/javascript">

          window.Proj4js =
          Proj: function(code)
          return proj4(Proj4js.defs[code]);
          ,
          defs: proj4.defs,
          transform: proj4
          ;

          proj4.defs("EPSG:27700","+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +towgs84=446.448,-125.157,542.06,0.15,0.247,0.842,-20.489 +units=m +no_defs");

          var epsg4326 = new OpenLayers.Projection("EPSG:4326");
          var EPSG27700 = new OpenLayers.Projection("EPSG:27700");

          var lonLat = new OpenLayers.LonLat(-0.1279688, 51.5077286).transform(epsg4326, EPSG27700);
          alert(lonLat.lon + ' ' + lonLat.lat);

          </script>
          </body>
          </html>





          share|improve this answer

























          • If you are using the OS API some transforms are built in openspace.ordnancesurvey.co.uk/docs/4.0.0/files/OpenSpace/…

            – Mike
            May 22 at 12:58











          • We were using the openspace api but are migrating to the OS API apidocs.os.uk/docs/os-maps-overview so have to remove the OpenSpace reference

            – Simon Jeffs
            May 22 at 13:06











          • see also gis.stackexchange.com/questions/120021/…

            – Mike
            May 22 at 13:32













          1












          1








          1







          OpenLayers 2 uses an earlier proj4 (version 1.1.0) syntax:



          Proj4js.defs["EPSG:27700"] = "+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +datum=OSGB36 +units=m +no_defs ";


          or with proj4 version 2:



          <!doctype html>
          <html lang="en">
          <head>
          <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.5.0/proj4.js"></script>
          <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/openlayers/2.12/OpenLayers.min.js"></script>
          </head>
          <body>
          <script type="text/javascript">

          window.Proj4js =
          Proj: function(code)
          return proj4(Proj4js.defs[code]);
          ,
          defs: proj4.defs,
          transform: proj4
          ;

          proj4.defs("EPSG:27700","+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +towgs84=446.448,-125.157,542.06,0.15,0.247,0.842,-20.489 +units=m +no_defs");

          var epsg4326 = new OpenLayers.Projection("EPSG:4326");
          var EPSG27700 = new OpenLayers.Projection("EPSG:27700");

          var lonLat = new OpenLayers.LonLat(-0.1279688, 51.5077286).transform(epsg4326, EPSG27700);
          alert(lonLat.lon + ' ' + lonLat.lat);

          </script>
          </body>
          </html>





          share|improve this answer















          OpenLayers 2 uses an earlier proj4 (version 1.1.0) syntax:



          Proj4js.defs["EPSG:27700"] = "+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +datum=OSGB36 +units=m +no_defs ";


          or with proj4 version 2:



          <!doctype html>
          <html lang="en">
          <head>
          <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.5.0/proj4.js"></script>
          <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/openlayers/2.12/OpenLayers.min.js"></script>
          </head>
          <body>
          <script type="text/javascript">

          window.Proj4js =
          Proj: function(code)
          return proj4(Proj4js.defs[code]);
          ,
          defs: proj4.defs,
          transform: proj4
          ;

          proj4.defs("EPSG:27700","+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +towgs84=446.448,-125.157,542.06,0.15,0.247,0.842,-20.489 +units=m +no_defs");

          var epsg4326 = new OpenLayers.Projection("EPSG:4326");
          var EPSG27700 = new OpenLayers.Projection("EPSG:27700");

          var lonLat = new OpenLayers.LonLat(-0.1279688, 51.5077286).transform(epsg4326, EPSG27700);
          alert(lonLat.lon + ' ' + lonLat.lat);

          </script>
          </body>
          </html>






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited May 22 at 16:21

























          answered May 22 at 12:54









          MikeMike

          3,025139




          3,025139












          • If you are using the OS API some transforms are built in openspace.ordnancesurvey.co.uk/docs/4.0.0/files/OpenSpace/…

            – Mike
            May 22 at 12:58











          • We were using the openspace api but are migrating to the OS API apidocs.os.uk/docs/os-maps-overview so have to remove the OpenSpace reference

            – Simon Jeffs
            May 22 at 13:06











          • see also gis.stackexchange.com/questions/120021/…

            – Mike
            May 22 at 13:32

















          • If you are using the OS API some transforms are built in openspace.ordnancesurvey.co.uk/docs/4.0.0/files/OpenSpace/…

            – Mike
            May 22 at 12:58











          • We were using the openspace api but are migrating to the OS API apidocs.os.uk/docs/os-maps-overview so have to remove the OpenSpace reference

            – Simon Jeffs
            May 22 at 13:06











          • see also gis.stackexchange.com/questions/120021/…

            – Mike
            May 22 at 13:32
















          If you are using the OS API some transforms are built in openspace.ordnancesurvey.co.uk/docs/4.0.0/files/OpenSpace/…

          – Mike
          May 22 at 12:58





          If you are using the OS API some transforms are built in openspace.ordnancesurvey.co.uk/docs/4.0.0/files/OpenSpace/…

          – Mike
          May 22 at 12:58













          We were using the openspace api but are migrating to the OS API apidocs.os.uk/docs/os-maps-overview so have to remove the OpenSpace reference

          – Simon Jeffs
          May 22 at 13:06





          We were using the openspace api but are migrating to the OS API apidocs.os.uk/docs/os-maps-overview so have to remove the OpenSpace reference

          – Simon Jeffs
          May 22 at 13:06













          see also gis.stackexchange.com/questions/120021/…

          – Mike
          May 22 at 13:32





          see also gis.stackexchange.com/questions/120021/…

          – Mike
          May 22 at 13:32











          0














          Ok, I figured out my issue. I looked at the post Mike shared Using Proj4js in Openlayers - Proj4js is not defined and tried the example code in my project which still failed. That narrowed it down to the js references. So I copied the references and et voila; success!



          My references:
          https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.5.0/proj4-src.js
          https://cdnjs.cloudflare.com/ajax/libs/openlayers/2.12/OpenLayers.min.js



          Changed to:
          https://cdnjs.cloudflare.com/ajax/libs/proj4js/1.1.0/proj4js-compressed.min.js
          https://cdnjs.cloudflare.com/ajax/libs/openlayers/2.13.1/OpenLayers.js



          Note that it worked with both versions of OpenLayers js file but not when using 2.5.0.



          Thanks to Ian and Mike for helping!






          share|improve this answer























          • 2..5.0 is working for me. I've added the code to my answer.

            – Mike
            May 22 at 16:23











          • Working with mine now too. Thanks Mike!

            – Simon Jeffs
            May 23 at 10:46















          0














          Ok, I figured out my issue. I looked at the post Mike shared Using Proj4js in Openlayers - Proj4js is not defined and tried the example code in my project which still failed. That narrowed it down to the js references. So I copied the references and et voila; success!



          My references:
          https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.5.0/proj4-src.js
          https://cdnjs.cloudflare.com/ajax/libs/openlayers/2.12/OpenLayers.min.js



          Changed to:
          https://cdnjs.cloudflare.com/ajax/libs/proj4js/1.1.0/proj4js-compressed.min.js
          https://cdnjs.cloudflare.com/ajax/libs/openlayers/2.13.1/OpenLayers.js



          Note that it worked with both versions of OpenLayers js file but not when using 2.5.0.



          Thanks to Ian and Mike for helping!






          share|improve this answer























          • 2..5.0 is working for me. I've added the code to my answer.

            – Mike
            May 22 at 16:23











          • Working with mine now too. Thanks Mike!

            – Simon Jeffs
            May 23 at 10:46













          0












          0








          0







          Ok, I figured out my issue. I looked at the post Mike shared Using Proj4js in Openlayers - Proj4js is not defined and tried the example code in my project which still failed. That narrowed it down to the js references. So I copied the references and et voila; success!



          My references:
          https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.5.0/proj4-src.js
          https://cdnjs.cloudflare.com/ajax/libs/openlayers/2.12/OpenLayers.min.js



          Changed to:
          https://cdnjs.cloudflare.com/ajax/libs/proj4js/1.1.0/proj4js-compressed.min.js
          https://cdnjs.cloudflare.com/ajax/libs/openlayers/2.13.1/OpenLayers.js



          Note that it worked with both versions of OpenLayers js file but not when using 2.5.0.



          Thanks to Ian and Mike for helping!






          share|improve this answer













          Ok, I figured out my issue. I looked at the post Mike shared Using Proj4js in Openlayers - Proj4js is not defined and tried the example code in my project which still failed. That narrowed it down to the js references. So I copied the references and et voila; success!



          My references:
          https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.5.0/proj4-src.js
          https://cdnjs.cloudflare.com/ajax/libs/openlayers/2.12/OpenLayers.min.js



          Changed to:
          https://cdnjs.cloudflare.com/ajax/libs/proj4js/1.1.0/proj4js-compressed.min.js
          https://cdnjs.cloudflare.com/ajax/libs/openlayers/2.13.1/OpenLayers.js



          Note that it worked with both versions of OpenLayers js file but not when using 2.5.0.



          Thanks to Ian and Mike for helping!







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered May 22 at 15:17









          Simon JeffsSimon Jeffs

          111




          111












          • 2..5.0 is working for me. I've added the code to my answer.

            – Mike
            May 22 at 16:23











          • Working with mine now too. Thanks Mike!

            – Simon Jeffs
            May 23 at 10:46

















          • 2..5.0 is working for me. I've added the code to my answer.

            – Mike
            May 22 at 16:23











          • Working with mine now too. Thanks Mike!

            – Simon Jeffs
            May 23 at 10:46
















          2..5.0 is working for me. I've added the code to my answer.

          – Mike
          May 22 at 16:23





          2..5.0 is working for me. I've added the code to my answer.

          – Mike
          May 22 at 16:23













          Working with mine now too. Thanks Mike!

          – Simon Jeffs
          May 23 at 10:46





          Working with mine now too. Thanks Mike!

          – Simon Jeffs
          May 23 at 10:46

















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Geographic Information Systems Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f323552%2fusing-proj4js-with-openlayers-to-transform-lat-lng-from-4326-to-27700-but-coming%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Wikipedia:Vital articles Мазмуну Biography - Өмүр баян Philosophy and psychology - Философия жана психология Religion - Дин Social sciences - Коомдук илимдер Language and literature - Тил жана адабият Science - Илим Technology - Технология Arts and recreation - Искусство жана эс алуу History and geography - Тарых жана география Навигация менюсу

          Bruxelas-Capital Índice Historia | Composición | Situación lingüística | Clima | Cidades irmandadas | Notas | Véxase tamén | Menú de navegacióneO uso das linguas en Bruxelas e a situación do neerlandés"Rexión de Bruxelas Capital"o orixinalSitio da rexiónPáxina de Bruselas no sitio da Oficina de Promoción Turística de Valonia e BruxelasMapa Interactivo da Rexión de Bruxelas-CapitaleeWorldCat332144929079854441105155190212ID28008674080552-90000 0001 0666 3698n94104302ID540940339365017018237

          What should I write in an apology letter, since I have decided not to join a company after accepting an offer letterShould I keep looking after accepting a job offer?What should I do when I've been verbally told I would get an offer letter, but still haven't gotten one after 4 weeks?Do I accept an offer from a company that I am not likely to join?New job hasn't confirmed starting date and I want to give current employer as much notice as possibleHow should I address my manager in my resignation letter?HR delayed background verification, now jobless as resignedNo email communication after accepting a formal written offer. How should I phrase the call?What should I do if after receiving a verbal offer letter I am informed that my written job offer is put on hold due to some internal issues?Should I inform the current employer that I am about to resign within 1-2 weeks since I have signed the offer letter and waiting for visa?What company will do, if I send their offer letter to another company