mhirdes / go_maps_ext Goto Github PK
View Code? Open in Web Editor NEWGoogle Maps Extension for TYPO3
License: MIT License
Google Maps Extension for TYPO3
License: MIT License
Default path to current cluster-images delivers 404 use own icons or https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m
I would love the option to hide all other commercial and non-commercial results in the map.
The G-Maps APIv3 gives the possibility to do so:
https://developers.google.com/maps/documentation/javascript/examples/hiding-features
https://developers.google.com/maps/documentation/javascript/styling (this is for a complete Styling guide)
A more simplyfied/cleaner map would be awesome!!
When creating/editing record, no map is shown in BE.
In addition I'm getting such a message in BE, when trying to edit record:
TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction No class named tx_gomapsext_tca
The reason is, that file is not auto-loaded by Composer.
Workaround: add autoload-files section
"autoload": {
"files": ["www/typo3conf/ext/go_maps_ext/class.tx_gomapsext_tca.php"]
},
Better fix: make this file follow psr-4 and be located in "Classes" folder.
Cookie consent tools often have the requirement to add specific data-attributes (e.g. data-src
and data-name
) in order to load scripts only when consent is given.
Currently it seems necessary to override MapController->initializeAction
and ScriptViewHelper->render
to correctly include the scripts with necessary data-attributes (using PageRenderer->addFooterData
).
Another current challenge is to include the scripts in the correct order. Would be awesome to ease this afford and allow easy integration into third-party consent management tools.
Hi Marc.
The function "infoWindow.closeByClick" doesn't work by me.
I can close InfoWindow only via X at the right corner.
BR, János
Since one of the last updates the maps card will not be displayed on page directly. Instead of this i got the link "show map" on click i get the old display of maps card into page.
I see no setting in backend to get the map shown again directly without using the link.
Using 2.4.0 on typo3 8.7.16
As this creates the Cookie this will block the ability to cache the page as soon as it creates this cookie.
As far as I know this cookie is not needed so I would like it not to be set.
My setup:
TYPO3: 10.4.0
go_maps_ext: 4.0.0-dev
Typo3: 8.7 & 9.5
go_maps_ext: v2.5 & 3.1 (& 3.1.1-dev)
Actually on none of my TYPO3 Sites custom Markers (also they are all SVG) are shown in latest IE.
In Chrome, FireFox, Opera & Safari its working flawless.
Maybe this is a IE compatibility issue of this extension?
Workes in TYPO3 v9.5.5 but is not working anymore in TYPO3 v9.5.6.
MAP is just not shown, but source-code contains the div <div class="js-map" id="gme-1"></div>
Getting a JS Error: (at the end of this line)
gme.ll={};gme.ll.alert="Bitte geben Sie eine gültige Adresse ein.";gme.ll.submit="Route berechnen";gme.ll.noSearchResults="Die Suche lieferte keine Ergebnisse.";gme.ll.infoWindowLinkText="Route berechnen
Getting this Error with 2 TYPO 3 Installations which I both updated to v9.5.6, had no problems before.
Tested on v3.1.0 and 3.1.1-dev
@mhirdes sorry for tagging but this problem now also occurs at a third installation by updating to 9.5.6
It would be really great if one could customize the cluster marker, like here.
Currently the latitude- and logitude input field type in the TCA configuration for tx_gomapsext_domain_model_address is set to double.
'latitude' => array(
'exclude' => 0,
'label' => 'LLL:EXT:go_maps_ext/Resources/Private/Language/locallang_db.xlf:tx_gomapsext_domain_model_address.latitude',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'double,trim,required'
),
),
This leads to a JavaScript error when using the extension in a TYPO3 environment set to german because decimal separator is set to , (comma) instead of . (dot), so rendered JavaScript looks like this:
gme.addresses[0] = {
title: 'Address Title',
latitude: 49,48254, <-- wrong decimal separator
longitude: 8,465676, <-- wrong decimal separator
address: 'Address String',
...
}
Instead you should use the f:format.number ViewHelper to force the decimal separator to a dot fixing that problem regardless of the TYPO3 environment:
go_maps_ext/Resources/Private/Partial/Map/Assign.html
latitude: {address.latitude -> f:format.number(decimals: '6', decimalSeparator: '.', thousandsSeparator: '')},
longitude: {address.longitude -> f:format.number(decimals: '6', decimalSeparator: '.', thousandsSeparator: '')},
First of all, thanks for you extension. I really appreciate all the work.
I have suggestion for the displaying of the categories checkboxes. As I need them to be grouped by their parent categories I changed line 133 in MapController.php from
$categoriesArray[$addrCat->getUid()] = $addrCat->getTitle();
to
$categoriesArray[$addrCat->getUid()]['title'] = $addrCat->getTitle();
$categoriesArray[$addrCat->getUid()]['uid'] = $addrCat->getUid();
$categoriesArray[$addrCat->getUid()]['parent'] = $addrCat->getParent();
In order to get an Array, including the parent category, so I can use the groupedFor fluid viewhelper.
<f:groupedFor each="{categories}" as="categoriesByParent" groupBy="parent" groupKey="parent">
// do something
</f:groupedFor>
I would like to do the same for the displaying of the addresses, but haven't gotten around to do it yet.
Currently the API is only configurable via TypoScript. This makes the Plugin useless for editors that do not have access to TypoScript but are allowed to edit the plugin.
There should be a way for the plugin to override the API key from the settings.
It should fallback like this: "Flexform ?: TypoScript ?: extension configuration".
This way editors can add their own maps without admin interference.
Due to some issues (#57, #55, #49) the latest official release will not work properly. Especially because of #57. Please release the next Release with all this fixed included. The latest version available on the TER (LINK) will not work on most of the TYPO3 v9 Versions.
A Fix-Release (including all the good fixes) could easily fix this.
It seems that the info window is closing automatically on mouseout of the pin "rect-area". It's not possible to click on the driving directions link, because the tooltip is closing too fast.
The option "Opened" is not working as well.
Tested with Chrome + Firefox on Mac.
This Issue is related to the use of go_maps_ext combined with staticfilecache.
When I create a page with a Google Map in it, the page will be declared as not cachable and is beeing slow.
This is most probably related to this extension as it is somewhere declared as not cachable.
But as far as I see it could be cachable just by "not declaring it as not cachable" as allways the same html/css/js is getting fired out.
A workaround is: forcing staticfilecache to cache it, but this will break a lot of other things.
Much cleaner solution is to not declare go_maps_ext as not cachable and let it cache its html staticly.
Would love to see this extension beeing compatible with staticfilecache
would it be possible here:
if (! $ this-> settings ['preview'] ['enabled']) {
$ pageRenderer -> {$ addJsMethod. 'Library'} (
'Google Maps',
$ This-> google maps library,
'Text / javascript'
false
false
''
true
);
}
add another option that you can disable the javascript, even if you do not want to use the "Preview Enable" version of the extension?
The background is that we like to embed the Javascript ourselves to control it over "Cookiebot".
It may also be that the Google Javascript is already involved once. Then it would be twice in the code.
There is the option:
Include JS from extension manually
basic.include_manually (boolean)
Unfortunately this only works for all other javascripts.
I would need this option for the TYPO3 8 version of go_maps_ext
Hi Marc.
Thank you for your work. There is a little misunderstanding for me:
https://docs.typo3.org/typo3cms/extensions/go_maps_ext/Introduction/Index.html
=> "Uses Version 3 of the Google Maps API, no API key needed"
https://maps-apis.googleblog.com/2016/06/building-for-scale-updates-to-google.html
=> "We no longer support keyless access"
BR, János
Hi, can I report a possible error for the 'version' => '3.0.0-dev' on Typo3 9.5.2?
We have an issue with the overlay and the controls settings. No zoom, pan, streetview or fullscreen buttons are appearing in the frontend. No matter what settings are used in the map.
Unfortunately there is no error message in the JS console.
The features like "maptype" (satellite/hybrid) and "list" are working.
If I get this right there's no option for using high resolution markers as google does for example with their logo on the map. In other google maps integrations you can just add the marker image for example in double the size and change the dimensions of the marker to half of that (works great for 2x retina devices). If I do this with this extension the marker image just gets cropped. Is there a way to get something like this with the current version?
When I'm using this extension on mobile devices on Chrome and zoom in. Then scroll (the page, not the map) down and up which is causing the window of Chrome getting smaller and bigger because of the URL-Bar. This is making this extension losing its zoom and jumpes back to standard.
Versions:
Typo3 v9.5.3
go_maps_ext v3.0.0
I noticed on some Wordpress G-Maps Extensions this behaviour is fixed but was there some years ago. Can you pls try to fix this?
If you want to I will make a video where this glitch is shown
Hi,
I have found in the file:
go_maps_ext/Configuration/TCA/tx_gomapsext_domain_model_address.php:
'map' => [
'config' => [
'type' => 'inline',
'foreign_table' => 'tx_gomapsext_domain_model_map',
'MM' => 'tx_gomapsext_map_address_mm',
'MM_opposite_field' => 'map',
],
],
Is it OK? Or a bug? (MM_opposite_field)
(https://docs.typo3.org/typo3cms/TCAReference/7.6/Reference/Columns/Select/#mm-opposite-field)
Regards,
János
I want to change the styling of the cluster icon. I looked at Pull Request #16 and when I understood this correctly you should be able to overwrite the styling using a JSON object in the Marker Cluster style code
field. But when I enter a simple {textColor: "#fff"}
it causes a JavaScript error in the frontend.
Is there an example how to correctly use this setting?
Thanks!
Hello,
Google is giving me this Error:
Google Maps JavaScript API warning: RetiredVersion https://developers.google.com/maps/documentation/javascript/error-messages#retired-version
Can you fix this please?
Thanks
Hi Marc,
I did some further analysis of your exension and have a feature request:
In form.html I have modified the following line:
<f:form.textfield **id="gmap-input"** name="saddress" **placeholder="Ihr Standort"** class="form-control js-gme-saddress" value="{request.saddress}" />
where I have added an id and a palceholder. I am not yet familier with typo3 translations. I have not used mulitlanguage sites yet, hence putting the text in the partial is for me OK.
The above I can do in my local variant of the resources.
But in order to use the places api from google I had to add the following to jquery.gomapsext.js
in GoMapsExt.Controller = function (element, gme) after the last _initialize call.
var input = /** @type {!HTMLInputElement} */(
document.getElementById('gmap-input'));
var autocomplete = new google.maps.places.Autocomplete(input);
autocomplete.bindTo('bounds', this.map);
You might want to put it into a subroutine as well, but for testing this place was OK
Now I have a type ahead address suggestion in the input field.
In order to use it we added the library to the URL to google Maps API:
//maps.google.com/maps/api/js?v=3.31&libraries=places
There are also possibilities to add the palce automatically to the map without pressing button, but I think it is not needed for me.
Maybe you can add the above four lines to yur extension and then user can decide to use palces by adding the libarary in the constants declaration.
best regards
Eckard.
My complete Site is set to german, also the Map and all the locations I added.
In the frontend the language also is german.
But when I call the G-Maps mobile it shows me "use two fingers to zoom" instead of "nutzen zwei Finger um zu zoomen".
I have the same version running on another TYPO3 instance, there it is german, but its all the same.
Maybe my API Key is englisch at one site?
If so: can this plugin force the language to the one selected in TYPO3?
Good work. Thanks a lot !!!!
But i think the length for city names is to small with max 20 chars.
city varchar(20) DEFAULT '' NOT NULL,
I just updated (from 2.5.0) to 3.0.0-dev because I'm on Typo3 9.4.0 and 9.5.0 (two installations) but when I update I cant save any Maps anymore.
It shows me:
Oops, an error occurred!
An exception occurred while executing 'SELECT `geolocation` FROM `tx_gomapsext_domain_model_map` WHERE `uid` = ?' with params [1]: Unknown column 'geolocation' in 'field list'
Am I doing something wrong or is it there a bug?
The official "typo3" user should only be maintainer of official TYPO3 products.
I get this error, when I install go_maps_ext in Typo3 7.4.0 and go to the Admin Tool > Extension:
Uncaught TYPO3 Exception
#1382276561: The package "go_maps_ext" depends on "typo3/cms" which is not present in the system.
When I remove require typo3/cms (line 20, file composer.json) it works ...
It would be nice to have not only one address-field containing "street, zip city", but 3 fields, containing the same data. So it's possible to read f.e. the zip of an address record.
Talked to Marc. Solution: The input-field "data_tx_gomapsext_domain_model_address_[x]_configuration_map_address" should be splitted into 3 fields (street, zip, city), stored in the DB and transmitted to Google.
Im using the current TER version. If I click on "Update by Address" it prefills lat and long to the correct coordinates. If I click "save" and the form reload the entries have updated and all data behind the dots (.) are cut.
If I remove the Double6Evaluator from TCA the fields save correctly. but get displayed with a comma (,) instead, which confuses the map in the backend
When I click on calculate route it brings me to G-Maps.
But it calls the Link:
https://maps.google.com/maps?daddr=[address]
then Google redirects it to:
https://www.google.com/maps?daddr=[address]
and then to:
https://www.google.com/maps/dir/[address]
Pls change all G-Maps links to the subdomain "www" instead of "maps".
And maybe adapt these maps URLs https://developers.google.com/maps/documentation/urls/guide
Thanks
If you select addresses in a map, they are ignored, as the controller use pid for finding addresses.
I patched the controller to use the selected one, and use the pid only if nothing is selected:
if ($map->getAddresses()) {
$addresses = $map->getAddresses();
} else { ...
As of 2.4.0 the maps are not loaded per default but only a preview (or at least that's how it should be as far as I can tell).
The "show maps" link which is displayed instead of the map does not work. The map cannot be displayed. Since this is the new default behaviour the update to 2.4.0 is a breaking change.
The new preview feature should not be default. Best practise to introduce new features is to make them optional at least in the beginning. plugin.tx_gomapsext.settings.preview.enabled should be 0 by default. Especially given that it doesn't work always/yet.
The documentation is wrong: https://docs.typo3.org/typo3cms/extensions/go_maps_ext/Configuration/Reference/Index.html#extension-configurations . The Variable has the same description as settings.infoWindow.imageMaxWidth.
Hi,
i got the following error in the browser console by using the preview function:
jQuery.Deferred exception: Unable to get property '_displayResult' of undefined or null reference
original german version:
jQuery.Deferred exception: Die Eigenschaft "InfoWindow" eines undefinierten oder Nullverweises kann nicht abgerufen werden.
TypeError: Die Eigenschaft "InfoWindow" eines undefinierten oder Nullverweises kann nicht abgerufen werden.
at GoMapsExt.Controller.prototype.initialize (https://example.com/typo3conf/ext/go_maps_ext/Resources/Public/Scripts/jquery.gomapsext.js?1547479101:63:10)
at GoMapsExt.Controller (https://example.com/typo3conf/ext/go_maps_ext/Resources/Public/Scripts/jquery.gomapsext.js?1547479101:52:13)
at $.fn.gomapsext (https://example.com/typo3conf/ext/go_maps_ext/Resources/Public/Scripts/jquery.gomapsext.js?1547479101:718:13)
at Anonymous function (https://example.com/typo3temp/assets/js/d4b3589af2.js?1547041515:101:5)
at j (https://example.com/typo3conf/ext/slickcarousel/Resources/Public/JavaScript/jquery.min.js?1504703152:2:29941)
at Anonymous function (https://example.com/typo3c
SCRIPT5007: Die Eigenschaft "InfoWindow" eines undefinierten oder Nullverweises kann nicht abgerufen werden.
jquery.min.js (2,31635)
Iam using Typo3 8.7.22 with the Introduction Package.
Also dosent work with Typo3 9.5.3
You can rebuild the error by using the following steps:
1: Install Typo3 with Introduction Package
2: Install go_maps_ext and include setup
3: Add the line to constants "plugin.tx_gomapsext.settings.preview.setCookieToShowMapAlways = 1"
4: Create a map and att the plugin to a side
5: Open the page in frontend and try out
I could not find, or there is no possibility to set custom marker via TypoScript?
If not, then it would be more a feature request.
I tried in constants and setup
plugin.tx_gomapsext.settings.marker = fileadmin/images/pin.png
Regards
Update:
Missleading Error-message.
I got the wrong url to a youtube video
Then everything is working fine.
The Google API key is missing when loading a page in the frontend.
I'm using TYPO3 8.7.3 and the current developer version of go_maps_ext, downloaded on 29th of Aug.
I already fixed the issue by basicly changing the name of setting for the API key. Please find enclosed the patch for this issue.
I have a page layout that already has coordinates in the page properties and a map should appear always at the same position on a page using this page layout. I thought about using go_maps_ext.
Is it possible to define a TypoScript Lib that renders the go_maps_ext plugin without the need of the datasets (maps and Address)?
Using the Extbase Bootstrap with Plugin name, Vendor name, etc. and calling it in Fluid via {f:cObject(typoscriptObjectPath: 'lib.renderGoMapsExtPlugin')}
is easy, but the plugin fails because the datasets are not there.
I just need to pass my already existing coordinates. Is this possible by any means?
Hi, weird bug here: google map doesn't display if <!DOCTYPE html>
is present in the html code.
No javascript error or any other errors. I'm on TYPO3 9.5 LTS and go_map_ext 3.2.0.
Seems a problem similar to this: https://stackoverflow.com/questions/9080575/google-map-api-doesnt-work-when-doctype-declared-in-chrome-and-firefox
because I can make the map to display even with <!DOCTYPE html>
if I cheat with the html code (moving the go-map container directly as child of <body>
) and with css like this:
html { height: 100% }
body { height: 100%; margin: 0; padding: 0 }
.tx-go-maps-ext, .js-gme-container { height: 100% }
I never encountered this problem in other installations with TYPO3 8 LTS and go_map_ext 2.3.2
Hi,
your extension uses InfoWindow. Custom styling in InfoWindow is very hard.
But custom styling with InfoBox is very simple.
Have you planed using InfoBox instead of InfoWindow?
Best Regards, János
Hey there,
is it possible to center and zoom the map manually when i have more than one pin shown on the map?
at the moment it centers the map automatically.
thanks for info
sys_category in setup.typoscript
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.