Bruce Roy Posted September 18, 2018 Report Share Posted September 18, 2018 Having installed and then uninstalled Open Street Map, I find that my map pins did not show in OSM and now do not show with Google maps reinstalled. There is a "Link to Google Maps" where the pins should be. The link opens a new tab in google.com/maps. The map pins are in the img folder - they just don't show on the web page. Checking in Firefox/Web Developer/Console I get this message: uncaught exception: InvalidValueError: initMap is not a function Any advice appreciated. Bruce Roy https://royroyes.net Quote Link to comment Share on other sites More sharing options...
Bruce Roy Posted September 19, 2018 Author Report Share Posted September 19, 2018 Thanks, Michael - all the TNG_12 js folder items are there. I notice that the map pins are in both img and googlemaps folders. Bruce Quote Link to comment Share on other sites More sharing options...
theKiwi Posted September 19, 2018 Report Share Posted September 19, 2018 On my site the line that has the map key is like this <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?language=&hl=en&key=39CharacterMapKeyHere"></script> On your site on this page, https://royroyes.net/getperson.php?personID=I4151&tree=rr_tree spread over 2 lines, it looks like this <script async defer src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDJn3pS9R8wNxRZgYv6XJbvyy8_eylio6k&callback=initMap" type="text/javascript"></script> AND The line with the map key call is AFTER the </head> line whereas it should come well before that. So two questions 1 - why is the line in seemingly the wrong place 2 - where is the "callback=initMap" coming from? Roger Quote Link to comment Share on other sites More sharing options...
Bruce Roy Posted September 19, 2018 Author Report Share Posted September 19, 2018 Thanks, Roger, I have changed the api script to your example and this hasn't changed anything. The "callback=initMap" is in your script so I assume it was in the script I previously had. It still appears as "uncaught exception: InvalidValueError: initMap is not a function" in Firefox Console. Bruce Quote Link to comment Share on other sites More sharing options...
theKiwi Posted September 20, 2018 Report Share Posted September 20, 2018 3 hours ago, Bruce Roy said: The "callback=initMap" is in your script What does this mean? That string is not in the example I posted from my site above? Roger Quote Link to comment Share on other sites More sharing options...
Bruce Roy Posted September 20, 2018 Author Report Share Posted September 20, 2018 I have fixed that, Roger. I have been having some issues with FTP-ing and I think what happened was that I thought I had uploaded the new code - but I hadn't! But now I have no maps at all. They were at least displayed in a person's page without pins. Incidently, I have not yet recorded my credit card details with Google. I have been all over Google trying to find where I can do it! No messages from Google about it, either. Thanks for your help Bruce Quote Link to comment Share on other sites More sharing options...
Bruce Roy Posted September 20, 2018 Author Report Share Posted September 20, 2018 To add to my last: I have found a way to register my account with Google API - and nothing has changed: no maps or pins Quote Link to comment Share on other sites More sharing options...
theKiwi Posted September 22, 2018 Report Share Posted September 22, 2018 Looking at a page on your site it says in the source code view [blocked] The page at https://royroyes.net/placesearch.php?psearch=Canberra%2C+ACT%2C+Australia was not allowed to run insecure content from http://maps.googleapis.com/maps/api/js?language=&hl=en&key=AIzaSyCNKgWy5oe5EgfpzyR26ELbwZBzsp_E2Rs. [blocked] The page at https://royroyes.net/placesearch.php?psearch=Canberra%2C+ACT%2C+Australia was not allowed to run insecure content from http://maps.googleapis.com/maps/api/js?language=&hl=en&key=AIzaSyCNKgWy5oe5EgfpzyR26ELbwZBzsp_E2Rs. The problem is you're requesting http when Google wants it to be https So where did you set that code to be only http since TNG now recognises either and handles sending the right version of it to Google. Roger Quote Link to comment Share on other sites More sharing options...
Bruce Roy Posted September 24, 2018 Author Report Share Posted September 24, 2018 According to Google's own advice you can use either https or http. I have tried both. Firefox Console says: Google Maps JavaScript API error: ApiNotActivatedMapError https://developers.google.com/maps/documentation/javascript/error-messages#api-not-activated-map-error js:48:173 I don't understand "api-not-activated-map-error js:48:173". I have tried to track down this issue on Google Cloud Platform but I get nowhere. Maybe OpenStreetMap is the only way to go! Bruce Quote Link to comment Share on other sites More sharing options...
Bruce Roy Posted September 24, 2018 Author Report Share Posted September 24, 2018 After a mindboggling search through Google Cloud Platform, I have managed to activate Google maps in TNG - partially. I get a map on a person's page! but with no pins either on the map or in the index of places on the left of the person's events. These are replaced by "Link to Google Maps" or "?" (depending on which browser) for each place. When you select Link to Google Maps it opens a new browser window in Google Maps and the place is identified with a different address (and how long it will take you to drive there!). Is this a heritage of having installed OpenStreetMaps some time ago? There must be something in the TNG code that will fix this? Quote Link to comment Share on other sites More sharing options...
Ken Roy Posted September 24, 2018 Report Share Posted September 24, 2018 The Google Maps - Getting Started article on the TNG Wiki should be fairly close to what is needed to get a Google Maps API key. without a URL link to a site with the problem, one can only guess as to what a problem might be. The ? shown in the Event part of the table is because the pin icon is not displayed. Also there is no pins on the map itself Quote Link to comment Share on other sites More sharing options...
Bruce Roy Posted September 24, 2018 Author Report Share Posted September 24, 2018 You might have missed my earlier posts, Ken. Set up as far as map api is concerned is working. My map pins are in two locations - img and googlemaps. But they do not show and selecting ? (or open Google maps in some browsers) opens a new window in Google maps which makes its own description of the place at the co-ordinates. I have a hunch - but I don't have the skills to check this out - that having installed OpenStreetMap and then deleted it (via Mod Manager) there is still some code that has not reverted to a pure TNG installation. Web site is https://royroyes.net Quote Link to comment Share on other sites More sharing options...
Ken Roy Posted September 24, 2018 Report Share Posted September 24, 2018 Bruce, Installing and then uninstalling OpenStreetMap should have no bearing on the pins not showing. OpenStreetMap from what I know does nothing to the pin images. Please provide a link to a page that has the problem. I do not have the time to go searching people's site for where the problem might be. Quote Link to comment Share on other sites More sharing options...
Bruce Roy Posted September 24, 2018 Author Report Share Posted September 24, 2018 https://royroyes.net/getperson.php?personID=I832&tree=rr_tree Quote Link to comment Share on other sites More sharing options...
Ken Roy Posted September 24, 2018 Report Share Posted September 24, 2018 OK, found a page with a map. Firefox inspector shows that google_marker cannot create the pin number images. I do not know why no pins show on the map. Roger Moffat is more familiar than I am with Google Maps, maybe he can chime in as to what might cause a problem with google_marker.php Also I will out of town for the next week or so Quote Link to comment Share on other sites More sharing options...
Bruce Roy Posted September 25, 2018 Author Report Share Posted September 25, 2018 Thanks, Ken. Quote Link to comment Share on other sites More sharing options...
Bruce Roy Posted September 25, 2018 Author Report Share Posted September 25, 2018 I believe that my problem with map pins not showing arises from having installed the OpenStreetMap mod, then uninstalled and removed it. If you go to a cemetery listing you will see an OpenStreetMap heading and link even though it is not installed! - eg, https://royroyes.net/showmap.php?cemeteryID=7&tree= Quote Link to comment Share on other sites More sharing options...
XerxX Posted September 25, 2018 Report Share Posted September 25, 2018 Hi Bruce, As Ken said; the install/uninstall "should" have no effect on your pins showing or not. The OSM link at Cemeteries, and also at placesearch.php https://royroyes.net/placesearch.php?psearch=Sydney%2C+NSW%2C+Australia are original TNG code, the icon maybe added in TNG12. It has nothing to do with the OSM mod. However: If you PM me your getperson.php file (the running one) I can inspect it for OSM mod "residue" and remove it for you if there is any. Best regards, Erik Quote Link to comment Share on other sites More sharing options...
theKiwi Posted September 25, 2018 Report Share Posted September 25, 2018 Try uploading a new copy of the file google_marker.php to your site's root directory. Check in your TNG Admin ------> Setup ------> Diagnostics to make sure that it says the GD Library is installed and available. Why is the call to Google with your Map Key placed outside of the <head> </head> section, and surrounded by comment lines - TNG normally places it inside the Head section of the HTML without comments. <!-- Google api goes here?? --> <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?language=&hl=en&key=AIzaSyCNKgWy5oe5EgfpzyR26ELbwZBzsp_E2Rs"></script> <!-- Google api --> Where have you placed this line so that it's showing after the </head> with the comment lines? Roger Quote Link to comment Share on other sites More sharing options...
Bruce Roy Posted September 25, 2018 Author Report Share Posted September 25, 2018 Thanks, Roger. There has been no problem getting the map to show, but I have re-located the Google api script to where I think it should be in the header? I have re-uploaded google_marker. Still no map pins! Quote Link to comment Share on other sites More sharing options...
theKiwi Posted September 25, 2018 Report Share Posted September 25, 2018 A couple of things... 1 - I don't understand why you say you have "relocated the Google api script..." - why are you manually putting it somewhere? You are meant to go to TNG Admin ------> Settings ------> Map Settings, and put your Google Map Key in the appropriate box there - just the map key. TNG takes care of inserting that with the right code into the appropriate place in the <head> </head> section of the page - which by the way is NOT the header!! - where you currently have it. Then delete those lines from wherever it is you have placed them currently. 2 - this may be why the pins don't show on the map, due to TNG not actually realising you have a Map Key if you haven't put it into TNG Admin? 3 - the pins beside the legend aren't showing and they should show at a URL like this - https://royroyes.net/google_marker.php?image=038.png&text=6 - but it gives the broken image icon. So the pins won't show at least until you can figure out why this isn't showing - what is stopping the google_marker.php script from doing its job of taking the pin icon 038.png and writing the digit 6 on top of it like you see here http://lisaandroger.com/tng/google_marker.php?image=038.png&text=6 ? Does your cPanel's error log give a clue if you try to load that link to your site? The pin is there because this works https://royroyes.net/img/038.png, proving that the pin is in the expected place. 4 - you didn't answer if you looked to make sure that the GD Library is shown as enabled. Roger Quote Link to comment Share on other sites More sharing options...
Bruce Roy Posted September 25, 2018 Author Report Share Posted September 25, 2018 Thanks, Erik. The icon in cemeteries is Openstreetmap_logo_small.png (which I will delete) and there is a link to https://www.openstreetmap.org/#map=17/51.403535/-0.674849 (from: https://royroyes.net/showmap.php?cemeteryID=7&tree= I'll attach my current getperson.php file. I appreciate any help! Bruce getperson.php Quote Link to comment Share on other sites More sharing options...
Bruce Roy Posted September 25, 2018 Author Report Share Posted September 25, 2018 Thanks, Roger. I have tried not using the google script, relying on the TNG code - I have the API in TNG setup where it should be as well as the script (which I have now disabled again - and now the maps are not showing!!). This is getting weird! I'm not sure what is meant by the GD Library? Quote Link to comment Share on other sites More sharing options...
XerxX Posted September 25, 2018 Report Share Posted September 25, 2018 Bruce, I checked your file and all the orginal lines are there and none of the OSM mod lines. (Maybe worth noting: The file I received had an empty line between every line. I've seen it before when opened/saved in BBEdit(?) on a Mac.) The OSM icon you say you're deleting - why? - is TNG original code. Check Darrin's site: http://lythgoes.net/genealogy/placesearch.php?psearch=England Regards, Erik Quote Link to comment Share on other sites More sharing options...
Bruce Roy Posted September 25, 2018 Author Report Share Posted September 25, 2018 Thanks again, Erik. I have restored the OSM image. I must confess that after years of using TNG I am beginning to think it is getting too complicated for me. I spend a lot of my time sorting out issues instead of doing genealogy! Bruce Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.