Coder Social home page Coder Social logo

grav-plugin-google-maps's People

Contributors

bivainis avatar butchewing avatar finanalyst avatar flaviocopes avatar michaelkonecny avatar ndrosis avatar royalrex avatar salgua avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

grav-plugin-google-maps's Issues

Needs to re-save md file or clear-cache to show map (cache problem)

Hello!

Map works on dev server:
image

But not working on production shared server:
image

My site has 2 languages and with EN it works, but with RU not... hmmm
I began to look at the difference in the files and found an empty line at the end of the RU file:
image

I deleted this line and map now works 😮
How it could be happen?

Js bottom loading

Hello!

My map isn't working because I use minify and bottom loading, but this plugin loads js files into head section.
What I see in console:
image

How to solve?

Not HTML valid

When I entered google maps code into a simple page, HTML validator shows this error:

No p element in scope but a p end tag seen.

The code looks this:

<p><div id="map-6b62c0c981" class="google-map" style="width: 100%; height: 400px"↩
     data-lat="48.578131"↩
     data-lng="19.152726"↩
     data-zoom="16"↩
     data-scrollwheel="true"↩
     data-draggable="1"↩
     data-pancontrol="true"↩
     data-iconurl=""↩
     data-infowindow="">↩
</div>↩
</p>↩

The problem is the google maps code is inside of p tags.

Installation succeed, but grav won't work anymore

Hello,

I tried to install the plugin via bin/gpm install google-maps, the installation succeed, but if I try to access to my website (localhost with Wamp or online, I tried both) I got this error:

Whoops\Exception\ErrorException thrown with message "Non-static method Grav\Common\Plugin::isAdmin() should not be called statically"

Stacktrace:
#11 Whoops\Exception\ErrorException in C:\wamp\www\grav\user\plugins\google-maps\google-maps.php:25
#10 Grav\Common\Plugin:isAdmin in C:\wamp\www\grav\user\plugins\google-maps\google-maps.php:25
#9 Grav\Plugin\GoogleMapsPlugin:getSubscribedEvents in C:\wamp\www\grav\vendor\symfony\event-dispatcher\EventDispatcher.php:139
#8 Symfony\Component\EventDispatcher\EventDispatcher:addSubscriber in C:\wamp\www\grav\system\src\Grav\Common\Plugins.php:104
#7 Grav\Common\Plugins:init in C:\wamp\www\grav\system\src\Grav\Common\Processors\PluginsProcessor.php:18
#6 Grav\Common\Processors\PluginsProcessor:process in C:\wamp\www\grav\system\src\Grav\Common\Grav.php:126
#5 Grav\Common\Grav:Grav\Common{closure} in C:\wamp\www\grav\system\src\Grav\Common\Grav.php:368
#4 Grav\Common\Grav:Grav\Common{closure} in C:\wamp\www\grav\system\src\Grav\Common\Grav.php:344
#3 call_user_func_array in C:\wamp\www\grav\system\src\Grav\Common\Grav.php:344
#2 Grav\Common\Grav:__call in C:\wamp\www\grav\system\src\Grav\Common\Grav.php:127
#1 Grav\Common\Grav:measureTime in C:\wamp\www\grav\system\src\Grav\Common\Grav.php:127
#0 Grav\Common\Grav:process in C:\wamp\www\grav\index.php:52

If I uninstall the plugin, everything works as a charm.
Do you have any idea ?

Thank you in advance.

GMaps Javascript library not loading with caching on after first use

This may be the same or related to #22 but I can't be sure from its description. I apologise that my problem description may also be vague and difficult to reproduce. It has been tricky to pin it down to a pattern. I'll try to describe my environment comprehensively, please let me know if more info is required.

The behaviour I see is that when I enable caching on a page with maps, the map (and library) load the first time, but not on subsequent refreshes - obviously I see a blank div where the map should be. The javascript code is not included in the source. This is easy to work around for individual pages (using cache_enable in frontmatter but it would be better to find the cause :)

I have extended your plugin to add support for map Places shortcodes but I don't think my extensions modify any original plugin code. (When I have time to make the code more generic, I will submit my fork with new features as a pull request.)

Asset pipeline settings seem to make no difference, as I originally thought that was the problem.

I'm running Grav on nginx with the following plugins, all up to date:

  • Admin Panel
  • Data Manager
  • DevTools
  • Email
  • Error
  • Featherlight
  • Form
  • Google Analytics
  • LightSlider
  • Login
  • Maintenance
  • Markdown Notices
  • Problems
  • Shortcode Core
  • Sitemap

I also have three custom plugins but none of them use Javascript at the moment. I'm extending the Antimatter theme.

Hope that helps. Please let me know if you require more details.

Single quotes around width and height parameters in shortcode do not work

If you add the width or height parameters with single-quotes in the shortcode, those values do not get properly passed to the style attribute in the div, and simply fall back on the set defaults.

You need to use double-quotes to have those values passed properly.
This is probably an issue more with shortcodes in general, rather than this Maps plugin in particular, but updating your example would be helpful.

Shortcode is not interpreted by grav

I am quite fresh Grav user and I am struggling with using your plugin.

I have instlled fresh grav with admin plugin (no extras) and added three plugins to check it:

Google maps (added via admin panel)
Shordcode core (added as depenency gy grav admin panel)
Shortcode UI (added via admin panel)

Shortcodes from Shortcode UI are working fine, but shortcode from Google maps doesn't work (Google API key is added).

You may see how it looks like on this page:
http://choinki2.twojedecyzje.pl/

Any suggestion is welcome, maybe I am doing something wrong.

map not showing without clearing grav cache

am hoping to use the plugin and it appears to want to work . on first load of the page the map works fine. when i leave the page and return to the map the page wont load. or it loads but map is not visible. to view the map again i need to clear the grav cache and when done the map shows again. any ideas what is happening here. im getting the same result in firefox and konquror. the map is located http://45.55.176.255/locate. any insight would be really appreciated

Example with json in readme, how to get this to work

Is this plugin being maintained? Not much activity.

I am probably doing something wrong (not a coder) but where do I put the json content? I just tried this from the readme file. The non json example does work

[google-maps width='100%' zoom=2 scrollwheel=true panControl=true content=json]
[
{"key":"20:53", "lat": 22.42559832, "lng": 114.2123749 },
{"key":"21:09", "lat": 22.41401143, "lng": 114.21253759 },
{"key":"21:20", "lat": 22.42327849, "lng": 114.21259051 },
{"key":"21:42", "lat": 22.44140609, "lng": 114.17303335 }
]
[/google-maps]

Map is empty. Am I missing something?
Anyone using this with json?

Include in template

Hi,

it's possible include the google map in a twig template?

Thanks,
Andrea

installing this broke my grav installation

When I installed this plugin via gpm cli, this happened.

root@zoid:/srv/zoid/grav# bin/gpm install google-maps

GPM Releases Configuration: Stable



The following dependencies need to be installed...
  |- Package shortcode-core

Install this package? [Y|n] Y
Preparing to install Shortcode Core [v2.3.1]
  |- Downloading package...   100%
  |- Checking destination...  ok
  |- Installing package...    ok
  '- Success!


Dependencies are OK

Preparing to install Google Maps [v1.0.6]
  |- Downloading package...   100%
  |- Checking destination...  ok
  |- Installing package...    ok
  '- Success!


Clearing cache

Cleared:  /srv/zoid/grav/cache/twig/*
Cleared:  /srv/zoid/grav/cache/compiled/*
Cleared:  /srv/zoid/grav/images/*

Touched: /srv/zoid/grav/user/config/system.yaml

root@zoid:/srv/zoid/grav# bin/gpm install recaptchacontact
PHP Fatal error:  Cannot redeclare class Grav\Plugin\GoogleMapsPlugin in /srv/zoid/grav/user/plugins/google-maps/google-maps.php on line 55
root@zoid:/srv/zoid/grav# bin/gpm install recaptchacontact
PHP Fatal error:  Cannot redeclare class Grav\Plugin\GoogleMapsPlugin in /srv/zoid/grav/user/plugins/google-maps/google-maps.php on line 55
root@zoid:/srv/zoid/grav# bin/gpm uninstall googlmapsplugin
PHP Fatal error:  Cannot redeclare class Grav\Plugin\GoogleMapsPlugin in /srv/zoid/grav/user/plugins/google-maps/google-maps.php on line 55
root@zoid:/srv/zoid/grav# bin/gpm uninstall googlmapsplugin
PHP Fatal error:  Cannot redeclare class Grav\Plugin\GoogleMapsPlugin in /srv/zoid/grav/user/plugins/google-maps/google-maps.php on line 55
root@zoid:/srv/zoid/grav# cd user/plugins
root@zoid:/srv/zoid/grav/user/plugins# rm -rf google*
root@zoid:/srv/zoid/grav/user/plugins# bin/gpm uninstall googlmapsplugin
-bash: bin/gpm: No such file or directory
root@zoid:/srv/zoid/grav/user/plugins# cd ..
root@zoid:/srv/zoid/grav/user# cd ..
root@zoid:/srv/zoid/grav# bin/gpm uninstall googlmapsplugin
Nothing to uninstall.
root@zoid:/srv/zoid/grav#

but even with the package removed the problem went on. I was getting 500 errors, so in my php error.log it says

2016/10/26 22:35:07 [error] 12538#0: *5 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught exception 'RuntimeException' with message 'Opening file for writing failed on error fopen(/srv/zoid/grav/cache/compiled/blueprints/master-zoid.php): failed to open stream: Permission denied' in /srv/zoid/grav/vendor/rockettheme/toolbox/File/src/File.php:202
Stack trace:
#0 /srv/zoid/grav/vendor/rockettheme/toolbox/File/src/File.php(316): RocketTheme\Toolbox\File\File->lock()
#1 /srv/zoid/grav/vendor/rockettheme/toolbox/File/src/PhpFile.php(31): RocketTheme\Toolbox\File\File->save(Array)
#2 /srv/zoid/grav/system/src/Grav/Common/Config/CompiledBase.php(236): RocketTheme\Toolbox\File\PhpFile->save(Array)
#3 /srv/zoid/grav/system/src/Grav/Common/Config/CompiledBase.php(100): Grav\Common\Config\CompiledBase->saveCompiledFile('/srv/hudsonpian...')
#4 /srv/zoid/grav/system/src/Grav/Common/Service/ConfigServiceProvider.php(65): Grav\Common\Config\CompiledBase->load()
#5 /srv/zoid/grav/system/src/Grav/Common/Serv" while reading response header from upstream, client: 24.105.233.41, server: , request: "GET /grav/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/ajenti-v-php-fcgi-zoidcom-php-fcgi-0.sock:", host: "zoid"

This is what happened the first time. I removed the plugin folders, then had to chmod -R a+w grav for it to stop erring. The second time I tried to see if it was consistent. I was able to uninstall it through gpm perfectly fine, and the error stopped happening once I did that. This could be because I had changed file permissions of the google* folders to 777 while in FTP because it wasn't letting me remove them, thus the rm -rf.

When I install via admin panel it works fine. Please see if you can reproduce. Grav v1.1.8
I'm running ajenti-v with this configuration http://support.ajenti.org/topics/1267-tutorial-installing-grav-on-ajenti-v/

Javascript does not get registered

Trying out the plugin the current grav version I had the problem that the javascript was missing after the first call.

Changing the code in MapShortcode.php to

$this->shortcode->addAssets('js', '//maps.googleapis.com/maps/api/js'.$apikeystring);
$this->shortcode->addAssets('js', 'plugin://google-maps/js/google-maps.js');

helped.

Updating from 1.0.3 to 1.0.8 breaks Grav

A fatal error occurred when I tried to update this plugin within Admin.

Non-static method Grav\Common\Plugin::isAdmin() should not be called statically
in
…/user/plugins/google-maps/google-maps.php 25

It breaks Admin and also my whole grav website. Luckily I took a backup just before this.

I have PHP Version 5.6.25 if it's any help. My Grav is at version 1.1.17, and Admin 1.2.2.

Google Maps and minify

The map will not come up if minifiers are enabled. (external CSS and JS)

Grav 1.1.12

Uncaught ReferenceError: google is not defined
    at HTMLDivElement.<anonymous> (a0969a1….js:75)
    at Function.each (a0969a1….js:1)
    at n.fn.init.each (a0969a1….js:1)
    at HTMLDocument.<anonymous> (a0969a1….js:75)
    at j (a0969a1….js:1)
    at Object.fireWith [as resolveWith] (a0969a1….js:1)
    at Function.ready (a0969a1….js:1)
    at HTMLDocument.K (a0969a1….js:1)

Point without message

Hello!

I have this code:

[google-maps width='100%' lat=46.994520 lng=142.728313 zoom=15 scrollwheel=true panControl=true]
[/google-maps]

And I see the result:
image

How to disable bubble if message not set?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.