Jump to content

Map Marker Map


ryan

Recommended Posts

  On 12/24/2018 at 2:54 AM, mel47 said:

Hi

I have a problem that I didn't have before (not sure when was "before" though...). However all last year' pages displayed a correct localization.

If I typed an address, it will not localized until I check/uncheck the geocode true/false. However, saving the page doesn't retain the "ok rooftop" result, and return to "request denied". After a couple of saving pages, I eventually get lat/long saved but the status is still "request denied".

Furthermore, I discovered I can't modify addresses on certain pages (those created by guest (form builder)). It may be related to my similar problem about image undeletable.

Under 3.0.123, both local and production. Google API is enabled for billing. Anyway, address with a previous correct localization are displayed fine.

Thanks!

Expand  

I found a workaround, related to an other issue. I ended by moving the order of fields.
BTW, no error in console.

Thanks

Link to comment
Share on other sites

  • 1 month later...

Maybe I'm missing something, but now, where once Google maps were working, I get a message saying that Google maps did not load correctly.  I believe it is because Google now requires an api key.  But I can't see where to put an api key into the markupgooglemaps module.  How do I make maps work again?

 

Link to comment
Share on other sites

My API key is configured correctly in FieldtypeMapMarker. I have the same problem than kbutler64 tough... Saying that Google maps did not load correctly on each map.

These are the error I get in Chrome inspector:

util.js:221 Google Maps JavaScript API warning: NoApiKeys https://developers.google.com/maps/documentation/javascript/error-messages#no-api-keys
lw.m @ util.js:221
util.js:221 Google Maps JavaScript API warning: SensorNotRequired https://developers.google.com/maps/documentation/javascript/error-messages#sensor-not-required
lw.m @ util.js:221

As requested by the module document, i added this line in the head: 

<script type='text/javascript' src='https://maps.googleapis.com/maps/api/js?sensor=false'></script>

Google now says it's not required.. I also notice this code,required by Google API, it not loaded in the page.  

<script async defer src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap"
  type="text/javascript"></script>

What should I do?

Link to comment
Share on other sites

You have to place this "<script src="https://maps.googleapis.com/maps/api/js?key=[your_API]"></script>" in the <head> part of your template or "head.inc" or whatever.

But you also have to register your site(s) with a Google Cloud Platform https://console.cloud.google.com/apis/credentials for it to allow the API on that site.

Link to comment
Share on other sites

  • 2 weeks later...

Hello!

This field holds 3 pieces of data. The address, longitude and latitude. The latter two are numerical data which does not need translation. The address field is what is send to Google to get the coordinates. I do not think there is an easy way to make it multilingual (it is not now as far as I know). But there is always a way to store multilingual address information in other fields of the same page, and use this information to generate marker descriptions (for example) for each language needed.

Link to comment
Share on other sites

  • 1 month later...

Hey everyone,

I did see, that other users were struggling with the problem, that there are no Markers displayed in the frontend, but I could not find any replies to that problem. 
If I render a map, the coordinates are correct, but the marker icon is not displayed. It displays in the backend, but not in the frontend, also if if but the path to a custom image in the map options. Nothing. 
Does anyone have the same problem?

Thanks for any hints

Link to comment
Share on other sites

Hi,

I have a recurrent problem of an error " 'MarkupGoogleMap' was used before it was defined. ". In some browser, the map display correctly but in some (IE) it just doesn't work.

I put the code in a JS validator, and I have the same error, but I don't know why and what I'm supposed to do, since I didn't play with this JS code. I also have " Expected 'mgmap1' at column 1, not column 37. "

  Reveal hidden contents

Thanks,

Mel

 

Link to comment
Share on other sites

  • 3 months later...

Are there any plans to officially make this compatible with 3.x? At the moment there's quite a few issues. When editing the field itself, it constantly says error geocoding address. In a page containing the field in the CMS it says the same on save, and it also says "REQUEST DENIED" under the map on load. To actually place a pin requires searching and then focusing off the box, pressing return will save the page but not update the marker.

  • Like 1
Link to comment
Share on other sites

  • 4 weeks later...

Based on the available methods in this module, it seems like the best approach is actually now:

$map = $modules->get('MarkupGoogleMap');
echo $map->getGMapScript();

You can see here: https://github.com/ryancramerdesign/FieldtypeMapMarker/blob/917edef8efe92bf8bdbdff62b66f6eca581ca57e/MarkupGoogleMap.module#L154-L165 that this will return the entore script tag you need, along with your API included.

Of course it would be nice if the module docs mentioned this ?

Link to comment
Share on other sites

  • 5 weeks later...

Hi,

Our problem is that we're making the map marker template from another template via page reference. We've tried to add our own checkbox "show map" but it has proven quite difficult to follow the geotag ON/OFF logic.

I would love to see if someone has figured this out.

TLDR

is there anyway for checking if the map is enabled, or do I have to make my own checkbox logic for it

 

Link to comment
Share on other sites

Hi after upgrading to ProcessWire 3.0.140 and trying to edit the field "mapmarker" from admin i got:

Fatal Error: Uncaught Error: Call to a member function prepend() on null in /var/www/www.designupgrade-test.com/wire/core/Fields.php:1066
Stack trace:
#0 /var/www/www.designupgrade-test.com/wire/modules/Process/ProcessField/ProcessField.module(1412): ProcessWire\Fields->getCompatibleFieldtypes(Object(ProcessWire\Field))
#1 /var/www/www.designupgrade-test.com/wire/core/Wire.php(380): ProcessWire\ProcessField->___buildEditFormBasics()
#2 /var/www/www.designupgrade-test.com/wire/core/WireHooks.php(813): ProcessWire\Wire->_callMethod('___buildEditFor...', Array)
#3 /var/www/www.designupgrade-test.com/wire/core/Wire.php(442): ProcessWire\WireHooks->runHooks(Object(ProcessWire\ProcessField), 'buildEditFormBa...', Array)
#4 /var/www/www.designupgrade-test.com/wire/modules/Process/ProcessField/ProcessField.module(1020): ProcessWire\Wire->__call('buildEditFormBa...', Array)
#5 /var/www/www.designupgrade-test.com/wire/core/Wire.php(380): ProcessWire\ProcessField->___buildEditForm()
#6 /var/www/www.designupgrade-test.com/wire/core/WireHooks.php(813): ProcessWire\Wire->_ca (line 1066 of /var/www/www.designupgrade.com/wire/core/Fields.php)

I also noticed that Compatibility is till 2.7 any chanche to upgrade to 3.0 ?
Does anybody solved in some way that issue?

Link to comment
Share on other sites

  • 4 weeks later...
  • 2 months later...
  On 10/17/2018 at 4:10 PM, rst said:

The way I was able to solve it, is you have to create 2 different api's. One for the front end, where you set restrictions to your domain name. And then another for this module where you set the restriction to your server's ip address. Also, make sure that geocoding api is enabled in google console.  Hope this helps.

 

 

Expand  

Thank you. I was just starting to lose it. One particular client insists on using Google Map instead of Open Street Map and I was getting nowhere. Geocoding wasn't working in the backend and the map wasn't showing on the front although there were no errors. Then I saw this post ^ and enabled the geocoding API in the Google Console.

This is important information for anyone having trouble.

Link to comment
Share on other sites

  • 4 months later...

After upgrade to Processwire 2.8 there is an issue with map markers. It is not compatible and not working correctly like
1) The sub location map is not displaying on admin on chrome it appears on double click but in Morzilla it works fine.
2) The sub location pointer gets reset to the default location even after saving.

Link to comment
Share on other sites

  On 5/13/2020 at 11:07 AM, horst said:

Why "upgrading" today to 2.8?? The current stable Version is 3.0.148, and 2.8 is years old and a dead end branch. It is not further maintained. Please use 3.0.148

Expand  

The site I'm working on was already upgraded to 2.8. Is the Map maker only compatible for the processwire 3.0.148?

Link to comment
Share on other sites

I've got the maps working on the front end and back end... got a single map with all points, and individual location maps on their pages. API set, account hooked up, everything seems to be awesome. 

I just want to output the street address in addition to the map, so I popped in:

<?php
echo $page->marker->address;    // outputs the address you entered

But when I do I am getting the full address PLUS lat./long and a little [n/a]->address - and want the FORMATTED ADDRESS:

621 W Manchester Blvd, Inglewood, CA 90301 (33.961857, -118.367332, 12) [N/A]->addres

^ that's the formatted_address from Google maps... from the previous 25 pages of historic notes it seems that  there's no easy way to extract this. Any $page->map->address, lat, lon - all returns the same feed, no doubt due to Google changes.

Options currently seem:

- long reverse engineering of the address and JSON parsing, 
- adding a second field and asking the data entry people to enter data twice...
- using another script like Ryan's and coding via the API...

Happy to have gotten this working  aside from this for the sake of getting it to work, and the map with all markers is lovely...but considering Google's charging for clicks? The Google Maps Text Formatter may be the easiest way to accomplish this for sites with light mapping needs. 
 

 

 

screencapture-set4-hollycodes-net-conference-breakout-sessions-2020-05-19-14_30_51.png

Edited by hollyvalero
EDITED: GIVING UP :-)
Link to comment
Share on other sites

  • 2 weeks later...

I'm new to processwire, I'm using ryan's MapMarker module and I've added the api key as well  in module config but still maps are not visible. It is still giving 

Oops! Something went wrong.
This page didn't load Google Maps correctly. See the JavaScript console for technical details.

and in console Google Maps JavaScript API error: RefererNotAllowedMapError.
Please help. Is there anything i'm doing wrong?

Link to comment
Share on other sites

This error indicates that you have not added your site's domain to the allowed referers for your Google Maps API key. See the error documentation here: https://developers.google.com/maps/documentation/javascript/error-messages#deverrorcodes

This didn't use to be required, but Google Maps is constantly becoming more strict with their API usage limits. Go to the cloud console and make sure to add your site's domain to the allowed referers for the key you're using, then it should start working again.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...