jploch Posted August 26, 2016 Share Posted August 26, 2016 31 minutes ago, matjazp said: 'icon' => $page->map_repeater->marker_icon->url ? you mean without the '' ? That didn't fix it. Link to comment Share on other sites More sharing options...
szabesz Posted August 26, 2016 Share Posted August 26, 2016 6 hours ago, jploch said: 'icon' => '$page->map_repeater->marker_icon->url', Variables in single quotes are not evaluated to their values, rather, they are treated as strings. You have to use double quotes to do that. However, @matjazp is right, you do not need any of them is this case, because the url is already a string. Link to comment Share on other sites More sharing options...
Robin S Posted August 26, 2016 Share Posted August 26, 2016 9 hours ago, jploch said: Here is what I tried: <?php $map = $modules->get('MarkupGoogleMap'); $options = array( 'height' => '100%', 'width' => '100%', 'icon' => '$page->map_repeater->marker_icon->url', ); $items = $page->map_repeater; echo $map->render($items, 'map', $options); ?> The 'icon' value needs to be a single image url. A repeater returns a PageArray, so you need to get a single page from it and then a single url from that page. Assuming that the formatted value of the marker_icon field is set to "single item" you would do something like this: 'icon' => $page->map_repeater->first()->marker_icon->url Also, the $options array is something that applies to the map as a whole. It allows you to set a single custom icon to be used across the whole map. I don't think the module provides support for setting different icons to different individual markers. 2 Link to comment Share on other sites More sharing options...
Kemal Posted August 27, 2016 Share Posted August 27, 2016 Hi, again i have another question, i need to mark region not specific coordinate. i mean when i click on map it will mark 2 km2 area here is example what i want https://developers.google.com/maps/documentation/javascript/examples/circle-simple how can i do it? Link to comment Share on other sites More sharing options...
bernhard Posted August 28, 2016 Share Posted August 28, 2016 the code is in your linked example, so what is your exact question? 1 Link to comment Share on other sites More sharing options...
Spica Posted August 28, 2016 Share Posted August 28, 2016 I wonder how to display plz (zip) areas in the map in additon to the markers. What do I mean: If you search in google maps for e.g. "schöneberg, berlin, deutschland" you get an overlay for that city destrict. I wonder, if you can adress this by the api. Dont want to make own overlays. Link to comment Share on other sites More sharing options...
Mats Posted August 28, 2016 Share Posted August 28, 2016 I don't think it's possible. Check out this SO answer: http://stackoverflow.com/questions/31861822/google-maps-how-to-show-city-or-an-area-outline/31865958#31865958 2 Link to comment Share on other sites More sharing options...
jploch Posted August 29, 2016 Share Posted August 29, 2016 On 26.8.2016 at 11:18 PM, Robin S said: Also, the $options array is something that applies to the map as a whole. It allows you to set a single custom icon to be used across the whole map. I don't think the module provides support for setting different icons to different individual markers. Thanks for your reply. You are right the icon variable only allows a single value. The post from nghi helped me to get it working with custom icons for each marker. Here is the code I used in the MarkupGoogleMap.module: /** Custom Fields */ foreach($pageArray as $page) { $marker = $page->get($fieldName); if(!$marker instanceof MapMarker) continue; if(!$marker->lat) continue; $url = $options['markerLinkField'] ? $page->get($options['markerLinkField']) : ''; $title = $options['markerTitleField'] ? $page->get($options['markerTitleField']) : ''; $icon = $page->marker_icon->url ? $page->marker_icon->url : ''; $map_location_name = $page->map_location_name ? $page->map_location_name : ''; $out .= "$id.addMarker($marker->lat, $marker->lng, '$url', '$title', '$icon', '$map_location_name'); "; } Maybe this will help someone. 3 Link to comment Share on other sites More sharing options...
Spica Posted August 30, 2016 Share Posted August 30, 2016 On 28.8.2016 at 9:33 PM, Mats said: I don't think it's possible. Check out this SO answer: http://stackoverflow.com/questions/31861822/google-maps-how-to-show-city-or-an-area-outline/31865958#31865958 Well, I tried to avoid this. Also found only similar solutions. But for those who are interested, here a link for plz files. Maybe I 'll give it a try. http://www.suche-postleitzahl.org/downloads Link to comment Share on other sites More sharing options...
charger Posted September 11, 2016 Share Posted September 11, 2016 @ryan It might be useful to update the module documentation regarding your latest release (2.0.8) from... <script type='text/javascript' src='https://maps.googleapis.com/maps/api/js?sensor=false'></script> to something like... <script type='text/javascript' src='https://maps.googleapis.com/maps/api/js?key=<?=$modules->FieldtypeMapMarker->googleApiKey?>'></script> ...in order for the frontend to also use the API key when rendering a map. 3 Link to comment Share on other sites More sharing options...
valan Posted September 21, 2016 Share Posted September 21, 2016 Today I've experienced interface issue - input fields were hidden (address, etc). After some inspection, I found that reason was in css - map has changed its relative position. I guess Google has changed smth in script that draws map as there were no changes in css locally. Do you have the same issue? To fix the issue I had to add custom style clear tag to InputfieldMapMarker.module line 161 "style='height: {$height}px;clear:left;' " . 6 Link to comment Share on other sites More sharing options...
Marvin Earp Posted September 22, 2016 Share Posted September 22, 2016 I'm having trouble with this field type. The map in the admin area is covering up the input fields. Can anyone think what might be causing this? Many thanks, Link to comment Share on other sites More sharing options...
bernhard Posted September 22, 2016 Share Posted September 22, 2016 same issue here! thanks @valan for the fix! Link to comment Share on other sites More sharing options...
flydev Posted September 22, 2016 Share Posted September 22, 2016 @Marvin Earp , Hi and welcome ! Which version of ProcessWire are you using and what is the admin theme ? You should try the fix of @valan : Link to comment Share on other sites More sharing options...
Marvin Earp Posted September 22, 2016 Share Posted September 22, 2016 46 minutes ago, flydev said: @Marvin Earp , Hi and welcome ! Which version of ProcessWire are you using and what is the admin theme ? You should try the fix of @valan : Thanks! That did the trick. Link to comment Share on other sites More sharing options...
adrian Posted September 22, 2016 Share Posted September 22, 2016 On 9/21/2016 at 2:29 AM, valan said: Today I've experienced interface issue - input fields were hidden (address, etc). After some inspection, I found that reason was in css - map has changed its relative position. I guess Google has changed smth in script that draws map as there were no changes in css locally. Do you have the same issue? To fix the issue I had to add custom style clear tag to InputfieldMapMarker.module line 161 "style='height: {$height}px;clear:left;' " . Thanks for this @valan - any chance you could submit this as an Issue or PR to Github? 1 Link to comment Share on other sites More sharing options...
rst Posted September 22, 2016 Share Posted September 22, 2016 I am having problems with accessing the map marker api. No matter what I do it just outputs the entire information in all the fields "address (lat, lng, zoom) [OK ROOFTOP]" if i add $page->map->lat it just adds "->lat" at the end of the output works now. needed to use {} brackets in my php Link to comment Share on other sites More sharing options...
valan Posted September 23, 2016 Share Posted September 23, 2016 17 hours ago, adrian said: Thanks for this @valan - any chance you could submit this as an Issue or PR to Github? Done.) 2 Link to comment Share on other sites More sharing options...
nbcommunication Posted September 23, 2016 Share Posted September 23, 2016 Hi, We recently migrated to a new server and we're been getting the following error when saving a page with a MapMarker on it: Error saving field "marker" - SQLSTATE[01000]: Warning: 1265 Data truncated for column 'lat' at row 1 A little digging and I got this error when saving the field: Geocode is not supported because 'allow_url_fopen' is disabled in PHP Is it possible to get around this? Can this function be replaced with a CURL request? Cheers, Chris Thomson Link to comment Share on other sites More sharing options...
kalimati Posted September 23, 2016 Share Posted September 23, 2016 I have been using MapMarker on a client site for long. Recently I updated the website to Processwire 2.7.2. While trying to add a page using a template with FieldTypeMapMarker I noticed the address box has vanished even though the default map shows. Underneath the map I can see "N/A". Any idea how to get back address box. Link to comment Share on other sites More sharing options...
nikoka Posted September 23, 2016 Share Posted September 23, 2016 I just ran into the same problem, the address box is gone and underneath it says "N/A". Anyone know what could cause this? Link to comment Share on other sites More sharing options...
nikoka Posted September 23, 2016 Share Posted September 23, 2016 Aaand here is the fix courtesy of @valan : Link to comment Share on other sites More sharing options...
nbcommunication Posted September 23, 2016 Share Posted September 23, 2016 Hello again, Fixed the previous issue by upgrading the module! However the map no longer displays - "google is not defined". It doesn't appear to be loading the maps api script. Anyone else come across this and have a solution? The site with the problem is running 2.5.3 Cheers, Chris Link to comment Share on other sites More sharing options...
nbcommunication Posted September 23, 2016 Share Posted September 23, 2016 It appears as if renderReady ($this->config->scripts->add($url)) isn't actually firing before the scripts are rendered to the admin template. I've prepended the script manually in default.php and this has fixed the issue, although I'd rather the module did it! We use a custom admin template, but I did switch over to the default one to test it, and the result was the same. I also have had to implement valan's "clear:left;" CSS fix from above. Link to comment Share on other sites More sharing options...
hellomoto Posted September 24, 2016 Share Posted September 24, 2016 In my page editor only the map is showing for the field, no inputs. PW 2.7.2 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now