Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3305560
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T21:11:00+00:00 2026-05-17T21:11:00+00:00

Hello I am having an issue using the proj4js library. Here is my source:

  • 0

Hello I am having an issue using the proj4js library. Here is my source:

<html>
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <script type="text/javascript" src="lib/proj4js-combined.js"></script>
   </head>

   <script type="text/javascript">
    function go()
    {
        var lon = document.getElementById("xOrg").value;
        var lat = document.getElementById("yOrg").value;
        var reprojected = reproject(Number(lon),Number(lat));

        document.getElementById("xNew").value = reprojected.x;
        document.getElementById("yNew").value = reprojected.y;
    }

    function reproject(lon,lat)
        {
            var sourceSys = new Proj4js.Proj('WGS84');
            var destSys = new Proj4js.Proj('EPSG:32187');

            var pointSource = new Proj4js.Point(lon,lat);
            var pointDest = Proj4js.transform(sourceSys, destSys, pointSource);

            return pointDest;
        }
   </script>

   <body>
    <div>
    <input id="xOrg" type="text" value="-73.56"/>
    <input id="yOrg" type="text" value="45.49"/>
    </div>
    <div>
    <input id="xNew" type="text" value=""/>
    <input id="yNew" type="text" value=""/>
    </div>
    <div>
        <input type="button" value="go" onclick="go()"/>
    </div>
   </body>
</html>

I don’t understand why the reprojection only works when I click the button twice, when I click on it the first time, the same values are returned. It seems to only work when I click the button twice or more. Here is this page online:
click

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T21:11:00+00:00Added an answer on May 17, 2026 at 9:11 pm
    var sourceSys = new Proj4js.Proj('WGS84'); 
    var destSys = new Proj4js.Proj('EPSG:32187'); 
    

    to here:

    ...
    
    <script type="text/javascript">  
        var sourceSys = new Proj4js.Proj('WGS84'); 
        var destSys = new Proj4js.Proj('EPSG:32187'); 
    
        function go()
    {
    ...  
    

    And for whatever reason it now works…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using RAILS 2.2 Hello I am having an issue where my dates are being
Hello I'm having an issue with this check box : <input type=checkbox id=hideTempSeries checked=checked
hello fellow java developers. I'm having a bit of an issue here. I have
Hello good morning everyone, i am having a weird issue when using imagePickerController. Actually
I am having an issue with using TabHost in a new Intent of type
Hello im having an issue when using the % operator in my class method
hello i am having same issue, i tried your solution but it didnt help
Hello I am having a problem with the numbering of figures using Latex, I
I am having a trouble using jQuery in my HTML. This might be a
I'm having a recursion issue in this code: using System; using System.Collections.Generic; using System.Linq;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.