elpwc / EldenRingOnlineMap

Elden Ring online map / 老头环在线多人协作编辑地图
https://www.elpwc.com/eldenringmap/
MIT License
302 stars 30 forks source link

Markers are not displayed #16

Closed Abbadon999 closed 2 years ago

Abbadon999 commented 2 years ago

I'm just a beginner, so it's hard for me to understand the whole compilation sequence After "npm run build", markers are not displayed, did I miss some point? I ran the map through "index.html" image After I created the database through phpmyadmin and transferred the "public" folder to the projects. But it didn't work, and now I'm getting this error image

I also tried to run the map through the "npm run dev" command, and in this case, some markers appeared, but for some reason I could not change anything: When I created custom markers, they disappeared after reloading the page ..

elpwc commented 2 years ago

It's hard to say if it's a php problem or a mysql problem without showing php's response data, You can find response data from press F12 in browserNetworkmap.php?type=...Response after reloading page.

Abbadon999 commented 2 years ago

Well, there is some kind of warning message here. image image MySQL I connected
image But now I'm getting a warning about the file "ipRequest.php" image

spking11 commented 2 years ago

Well, there is some kind of warning message here.

Probably because you run npm dev, this is for development. It will build bundle.js with a mock service which is just for the front-end test, it will intercept connections to the backend, then return mock data. Just run npm build and ensure the bundle.js is compressed, this indicates it built for production.

Abbadon999 commented 2 years ago

After configuring "dbcfg.php" I tried using npm build command and ran \public\index.html accordingly The map itself opens, but there are no markers, and I also cannot create my own markers, since the button to complete the creation is not pressed. Also, I can't get the admin, because when entering the password, the "ok" button is also not pressed

image Could it be related to MySQL?

elpwc commented 2 years ago

As you can see the error shows ...are only supported for protocal schemes: http, ...
Request sent to php files should be via 'http' but not 'file', before this, you have to start an Apache server (and other php runtime environment stuff) in your computer and navigate to the webpage by http://localhost:xxxx. (xxxx→port

Could it be related to MySQL?

Currently it obviously causes by a not installed/incorrectly installed php environment.

Abbadon999 commented 2 years ago

So, as you said, I launched the site through Apache, you can see it in the address bar, but now I get this error: image image As I see it, this is most likely related to MySQL, but I don’t understand what I did wrong..

elpwc commented 2 years ago

Seems caused by Google Analytics and Baidu Analytics codes (intercepted by ads blocker in your browser)
You can delete these analytics codes in index.html and then have a try, good luck!


  <script>
    var _hmt = _hmt || [];
    (function () {
      var hm = document.createElement('script');
      hm.src = 'https://hm.baidu.com/hm.js?36c2817b0416712d9807ee55315eaf4f';
      var s = document.getElementsByTagName('script')[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>

  <!-- Global site tag (gtag.js) - Google Analytics -->
  <script async src="https://www.googletagmanager.com/gtag/js?id=G-SP07Q8CYM7"></script>
  <script>
    window.dataLayer = window.dataLayer || [];

    function gtag() {
      dataLayer.push(arguments);
    }

    gtag('js', new Date());

    gtag('config', 'G-SP07Q8CYM7');
  </script>

  <!--Google AdSense-->
  <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1195280671714046"
    crossorigin="anonymous"></script>
elpwc commented 2 years ago

Seems like your server is not able to visit the map data(? Try to visit https://imgs.ali213.net/picfile/eldenring/4/6/6.jpg on your server

Abbadon999 commented 2 years ago

I'm sorry, I accidentally deleted more lines of code, now everything loads without errors, but when creating a marker, this message will still appear: image

elpwc commented 2 years ago

Oh... I'm so sorry, I forgot to add the 'is_lock' column into database.sql...
you can append this column by:

ALTER TABLE `eldenringmap`.`map` 
ADD COLUMN `is_lock` TINYINT(1) NULL DEFAULT '0';

and then it probably works

elpwc commented 2 years ago

Try to find the method error occured in map.php and add a @ in the front of the method.

Abbadon999 commented 2 years ago

Sorry, my mistake.. I repeat that I'm just a beginner.. But I did it! Thank you very much for helping!

elpwc commented 2 years ago

Awesome! Never mind it!