Forum

Openstreetmaps not ...
 
Notifications
Clear all

Openstreetmaps not loading in Letgo theme [Solved]

5 Posts
2 Users
0 Likes
380 Views
(@invisible)
Posts: 78
Estimable Member
Topic starter
 

I installed openstreetmaps plugin and obtained an API key. But the map is not showing.
When I enable Google Maps both are loading but location is incorrect.
Any idea about this issue?? [member=3]Defected[/member]

 
Posted : 16/02/2021 5:25 am
(@invisible)
Posts: 78
Estimable Member
Topic starter
 

Solved myself. Edited item.php file
In line 232, replace code

<?php if(function_exists('google_maps_location')) { ?>
                            <section>
                                <h2><?php _e('Location', 'letgo'); ?></h2>
                                <div class="map" id="map-small"><?php osc_run_hook('location'); ?></div>
                            </section>
                            <?php } ?>

With this


                            <section>
                                <h2><?php _e('Location', 'letgo'); ?></h2>
                                <div class="map" id="map-small"><?php osc_run_hook('location'); ?></div>
                            </section>
                           
 
Posted : 02/03/2021 9:29 am
Zero-Labs
(@zero-labs)
Posts: 82
Trusted Member
 

@invisible I'm about to embark on this journey again myself. Please tell me,

  • Which version of the plugin did you use?
  • Which version of Osclass did you successfully install this plugin on?
  • Has it been tested on Osclass v5.x.x?

I have an old version with file name 20151026103510_161_osm_maps.zip. Also found one by Darko @dev101 on github, https://github.com/dev-101/open_street_maps. The latter is probably the one I'll try first.

 
Posted : 11/10/2021 3:00 pm
Zero-Labs
(@zero-labs)
Posts: 82
Trusted Member
 

Disregard my last post. Getting OSM to display in Letgo is even simpler. Replace

<?php if(function_exists('google_maps_location')) { ?>
                            <section>
                                <h2><?php _e('Location', 'letgo'); ?></h2>
                                <div class="map" id="map-small"><?php osc_run_hook('location'); ?></div>
                            </section>
                            <?php } ?>

with

<?php osc_run_hook('location'); ?>

Done.

Now, what follows I also posted in the discourse.group, but since there is SO MUCH better engagement here, I'm copying here as well.

I’m trying to get OSM plugin v1.04 from Dev101 to work. GitHub - dev-101/open_street_maps: OpenStreetMap Maps plugin for Osclass (fork). By default, it unpacks from the zip file to directory open_street_maps_master. In order for anything at all to display in item.php, that directory must be renamed to open_street_maps, either locally before ftp to the server or on the server after ftp. I made certain to install the “Consumer key” in the OSM plugin index.php as instructed in the readme.md, as well as in Osclass under Settings/General. Also under Listings/settings, OpenStreetMaps is selected in the dropdown at the bottom of the page under Maps. I have tried Mapquest callback urls pointing to Locally-Grown.org and just https://locally-grown.org .

With the admin logon debug code inserted into footer.php, the coordinates returned are always
[d_coord_lat] => 0.000000
[d_coord_long] => 0.000000

I’ve dotted my “I’s”, crossed my “T’s”, no joy at all. Very frustrating. Thoughts anyone?

 
Posted : 14/10/2021 4:09 am
Zero-Labs
(@zero-labs)
Posts: 82
Trusted Member
 

Woooo hoooooo!  I got OSM to work. I think the key was setting my callback url correctly at the Mapquest Developer site to just the domain name, no http:// or https://. (ie. just locally-grown.org)

 

This post was modified 1 year ago 2 times by Zero-Labs
 
Posted : 15/10/2021 12:59 am
Share: