Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web Resource doesnt work due jQuery #130

Closed
ghost opened this issue Sep 29, 2018 · 12 comments
Closed

Web Resource doesnt work due jQuery #130

ghost opened this issue Sep 29, 2018 · 12 comments
Labels
Milestone

Comments

@ghost
Copy link

ghost commented Sep 29, 2018

Which resource(s) have this problem?
(Please do not include the resource in the title as we will assign a label)
webmap

Describe the bug
Whenever you open your webbrowser and access the resource / html file, you're getting the following error:

script.js:17 Uncaught ReferenceError: $ is not defined
at init (script.js:17)
at onload (map.htm:14)

To Reproduce
Steps to reproduce the behavior:

  1. start the resource
  2. load the http page (http://localhost:22005/webmap/map.htm on localhost)

Additional context
Maybe we should remove ajax resource and make use of jquery - we're not living in the past...

  • Luxy.c
@qaisjp
Copy link
Contributor

qaisjp commented Sep 29, 2018

This issue doesn't make any sense other than "remove Ajax use jQuery"

What is this issue actually about?

@ghost
Copy link
Author

ghost commented Sep 29, 2018

It does make sense. I also said "MAYBE" - not that we should.

Back to the issue exactly
script.js file basically uses jQuery syntax aka this line:
map = new OpenLayers.Map( $('map'), {'maxResolution': 360/512, 'maxExtent':new OpenLayers.Bounds(-90.0,-90.0,90.0,90.0), 'numZoomLevels':6, });

will fix it and commit a change on that later on.

  • Luxy.c

@qaisjp
Copy link
Contributor

qaisjp commented Sep 29, 2018

document.querySelector / document.querySelectorAll can be used instead of $('map')

@ghost
Copy link
Author

ghost commented Sep 29, 2018

Also OpenLayers should be removed or jQuery should be added because it uses jQuery internally. After resolving the above issue, theres another error (from OpenLayers.js):

error

// Edit: @qaisjp i've used document.getElementById("map") for that which should also be fine.

  • Luxy.c

@qaisjp
Copy link
Contributor

qaisjp commented Sep 29, 2018

I get a different error after fixing the $() usage:

image

Are you sure OpenLayers.js uses jQuery? I can't find anything about this online

@ghost
Copy link
Author

ghost commented Sep 29, 2018

Thats what i'm also get - working on it atm.

  • Luxy.c

@qaisjp qaisjp added resource:webmap bug web Web related issues labels Sep 29, 2018
@StifflersMom
Copy link

StifflersMom commented Sep 29, 2018

Open layers should be removed because the san andreas map was removed from OpenLayers a long time ago. That is the reason why webmap does not work anymore.
I have an own version working with a large map image instead, it's working "a little bit" but it's not ready for public :D

image

@ztajti
Copy link

ztajti commented Nov 20, 2018

Hi Guys!

I trying preparing the webmaps, but the http://code.opencoding.net/ waiting a float variable, and i make a float var, set the "An error occurred: invalid literal for int() with base 10: '7.0'" error message.

How i can prepare? Thanx.

$() usage error fixing:

map = new OpenLayers.Map( $("map"), {'maxResolution': 360/512, 'maxExtent':new OpenLayers.Bounds(-90.0,-90.0,90.0,90.0), 'numZoomLevels':6, });

replace the:
map = new OpenLayers.Map("map", {'maxResolution': 360/512, 'maxExtent':new OpenLayers.Bounds(-90.0,-90.0,90.0,90.0), 'numZoomLevels':6, });

do no't use jquery, because OpenLayers.Map first prefix is a div id param, doesn't a jquery element id.

#ZotyaDesign

@eAi
Copy link

eAi commented Jan 21, 2019

I wrote this resource initially, many years ago. I wasn't aware it has a dependency on opencoding.net (which I still own, but has changed significantly since then).

If there are particular files that are missing let me know - happy to re-host them at code.opencoding.net, if we can't work out what they are and find them. I have most of that stuff backed up, but I can't see immediately what files are missing.

@jlillis
Copy link
Contributor

jlillis commented Nov 11, 2020

@eAi A quick search of the code shows that webmap and element browser are looking for the following assets from code.opencoding.net:

  • mta/updatesite
  • tilecache/tilecache.cgi

One thing to consider, especially if the above assets cannot be recovered from backup: do we want to continue maintaining these web-based interfaces? My experience has been that they are not commonly used anymore and are ready for retirement.

@patrikjuvonen
Copy link
Contributor

This is fixed in #281

@jlillis
Copy link
Contributor

jlillis commented Feb 13, 2021

Fixed in #281

@jlillis jlillis closed this as completed Feb 13, 2021
@patrikjuvonen patrikjuvonen added this to the 1.5.9 milestone Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants