rvalitov / widgetkit-map-ex

Responsive version of Yootheme's Map Widget (Widgetkit2) with center map point and advanced features
GNU General Public License v3.0
22 stars 3 forks source link

Google Key is not saved #55

Closed blondie63 closed 7 years ago

blondie63 commented 7 years ago

I've a site with: chrome 54, joomla 3.6.4, widgetkit 2.8.2 , MapEx 1.5.2 and i've seen these issues:

  1. I can use Api Browser Key (restricted by site referring) but not Api Server key (restricted by server IP), why? i've many sites on same server so Server key it's better..

  2. I set Api Key on Widgetkit options and also in MapEx plugin global setting but the last one sometimes is not saved.. bug ? I also see that this field accept "auto" as value, what means ?

rvalitov commented 7 years ago

Thank you for creating a separate issue! My answers are below.

I can use Api Browser Key (restricted by site referring) but not Api Server key (restricted by server IP), why? i've many sites on same server so Server key it's better..

As far as I know Google supports only API Browser key for the Map API (more info at Google instructions). But if you are sure that Api Server Key is also supported, then, please, share the link to Google manual where you could find such information.

I set Api Key on Widgetkit options and also in MapEx plugin global setting but the last one sometimes is not saved.. bug ?

I have never faced this problem. May be you edit several MapEx plugins simultaneously and in this case they overwrite the API key of each other? Also, please, check the error.log file and make sure that the plugin is installed in the correct directory (follow the instructions). You may also try to activate the Debug output option to investigate possible problems, read more.

I also see that this field accept "auto" as value, what means ?

Can you please tell me how you see this? It's not written in the wiki, tooltips and instructions. The auto value is not supported as a valid value for the API key.

On Location field i can search an address but i cannot write coordinates ! why ?

Unfortunately, it's not supported by the original Map widget. And I didn't add such functionality to MapEx, too.

blondie63 commented 7 years ago

Yes Google support Api Server Key, you can create it by: https://console.developers.google.com About "auto": i've discovered casually double clicking on field, but you can try to write "auto" and you can see that it's accepted.. ps. sorry if i wrote so, without referring to your text but i'm starting for a trip..

rvalitov commented 7 years ago

Thank you for the answers!

Yes Google support Api Server Key, you can create it by: https://console.developers.google.com

I checked again the Google Developer Console and it seems that they updated a little bit the interface. Below I will list the instructions how to obtain the API key with the IP restriction. If it will work for you, then I will update the Wiki.

  1. Open link https://developers.google.com/maps/documentation/javascript/get-api-key#get-an-api-key
  2. Click the "Get A Key" button: get-key
  3. After standard screens you will be able to configure the restrictions for this key. You can use the IP restriction: api-key-ip
  4. Finally, in the list your key will look like this (it should have IP address restriction): test-api-key For domain restricted keys the value will be Referrer.

About "auto": i've discovered casually double clicking on field, but you can try to write "auto" and you can see that it's accepted

When you double click the field, then the browser shows you the autocomplete list. This list is not generated by the website - it's a feature of the browser that tries to make "smart" substitutions and make your life easier. However, the browser is not always smart and can give you the autocomplete suggestions based on values that you have entered before. But the browser doesn't know if it's valid value or not for this specific page or this specific input field.

As I said before, the word auto is not valid as the API key. This word can be used in parameters of the widget only if it's explicitly specified that auto value is supported (such information is usually written near the field itself or in its tooltip). But I will add a simple check for the API key #56

Please, let me know if my instructions above will help you. If not, then send me the error message (or error code) that Google shows you when you use the API key with IP restriction.

blondie63 commented 7 years ago

About Server Api Key: i've created exactly as you described and, as i've said, it does'nt work for me.. Have you also tried ? I've done a video to show my issues: https://vimeo.com/190021594

rvalitov commented 7 years ago

Thank you for the video! It was very helpful. I will do some more tests and will let you know about the results.

rvalitov commented 7 years ago

About Server Api Key: i've created exactly as you described and, as i've said, it does'nt work for me.. Have you also tried ?

I tried and have the correct answer for you now. Unfortunately, it's impossible to use the server key, read more #59. Sorry that I couldn't give you the answer right away.

I set Api Key on Widgetkit options and also in MapEx plugin global setting but the last one sometimes is not saved.. bug ?

Unfortunately, I can't simulate this situation. Can you please provide me the error.log file of Apache and/or PHP? Or can you give me the access to the backend of your website? You can send the access details privately to my email ramilvalitov@gmail.com

rvalitov commented 7 years ago

I could replicate the problem when Google Api key is not saved. The problem was in browser's cache.