ryan

Map Marker Map

Recommended Posts

@Bernhard

Which geocoding service are you using? You should certainly make sure you or others do not braking any usage limitations that you accepted.

  • Like 1

Share this post


Link to post
Share on other sites

hi lostkobrakai,

you are right, i removed the excel-sheet as it uses google maps api and you are only allowed to use it when you display the results on a map...

i thought google would handle the limitation on their own by just blocking too frequent requests per one IP

edit: they do

{
   "error_message" : "You have exceeded your daily request quota for this API. We recommend registering for a key at the Google Developers Console: https://console.developers.google.com/",
   "results" : [],
   "status" : "OVER_QUERY_LIMIT"
}

Share this post


Link to post
Share on other sites

It does not use any api key...

Note: The following Maps APIs previously did not require an API console key: Google Maps JavaScript API, Google Static Maps API, Google Street View Image API, Google Maps Geocoding API, Google Maps Directions API, Google Maps Distance Matrix API, Google Maps Elevation API, and Google Maps Time Zone API. This is still supported for legacy applications to ensure backwards compatibility, but is no longer recommended for new applications.

https://developers.google.com/maps/faq

anyway... just don't use my excel - it's nothing google's api was built for :)

Share this post


Link to post
Share on other sites

I'm getting the following error when trying to use the MarkupGoogleMap module to display a map in a page template:

Error: Call to a member function get() on a non-object

The code I'm using in the page template is:

$map = $modules->get('MarkupGoogleMap');
$map->render($page, 'geocode'); 

It's as if PW can't find the module, but I've got it installed (version 1.0.1).

If I click on the 'check for updates' link for this module it does give the error: Session: Error reported by web service: Unable to find that module

I've tried uninstalling/reinstalling but still no good.

Anyone have any ideas?

I'm using this module on an installation of PW 2.6.23 rc2

Tony.

Share this post


Link to post
Share on other sites

Recently MapMarker doesn't convert "48° 52′ 8″ N, 9° 23′ 55″ E" address coordinates to Latitude and Longitude anymore. Any chance this has something to do with upgrading PHP? That's about the only thing that changed. PW 2.7.2 and MapMarker 2.0.6.

Share this post


Link to post
Share on other sites

Hi,

I start to use the FieldtypeMapMarker for the contacts in the site:

http://dev.producoesindependentes.pt/beltain_new/contactos/

but the map is not rendered, the mao it self is not shown.

I did put the <script> in <head> and the code to render the map is:

<?php
$map = $modules->get('MarkupGoogleMap');
echo $map->render($page, 'google_map', array('width'=>'100%','height'=>'500px'));
?>

I think it is a javascript issue or a google maps javascript issue but it not raise any error.

How can I resolve this issue?

Than you

Share this post


Link to post
Share on other sites

Hi,

I tried to pass the lat, long and the zoom in the options

<?php
$map = $modules->get('MarkupGoogleMap');
echo $map->render($page, 'google_map', array('width'=>'100%','height'=>'300px', 'lat'=>'38.7237628','long'=>'-9.331723199999942','zomm'=>17));
?>

but didn't do nothing.

Share this post


Link to post
Share on other sites

I tried that,

<?php
$map = $modules->get('MarkupGoogleMap');
echo $map->render($page, 'google_map', array('width'=>'100%','height'=>'300px', 'lat'=>38.7237628,'lng'=>-9.331723199999942,'zoom'=>17));
?>

and the map didn't show.

<?php
echo 'lat: '.$page->google_map->lat;
echo '<br/>';
echo 'lng: '.$page->google_map->lng;
?>

and the values where "0.000000".

Well I will try until the map shows,

thank you.

Share this post


Link to post
Share on other sites

I was receiving that same issue of the lat and lng values being 0. When I tried to run the URL for the geocode, it kept giving me a Request Denied.

I had recently added my own server key and as well as postal codes components (for my own needs), and now can't reproduce the issue for the life of me.

Rather strange error as saving the address through the api was not geocoding correctly, but worked fine on the admin page if I clicked on the address input and clicked off.

Share this post


Link to post
Share on other sites

I am testing the module within PW 3.0.8 in a simple page with the following code :

<html>
<head>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.1/jquery.min.js"></script>
    <script type='text/javascript' src='https://maps.googleapis.com/maps/api/js?sensor=false'></script>
</head>
<body>

<?php 
    $map = $modules->get('MarkupGoogleMap');
    echo $map->render($page, 'google_maps');
?>

</body>
</html>

I have one error in developper tools :  SyntaxError: expected expression, got ','   9:333

The map does not appear either in backend.

I made a mistake or someone is able to reproduce this ?

Edit:  It suddenly work, you can delete this useless post :-X

Share this post


Link to post
Share on other sites

I am using the FieldtypeMapMarker module to display a location on a map. The address comes from a different database (see my other topic Parameterized template).

I tried this:

function getMap($object) {
  $map_module = wire('modules')->get('MarkupGoogleMap');
  $page = wire('page');
  $page->map->address = "{$object['strasse']} {$object['hausnummer']}, {$object['plz']} {$object['ort']}";
  var_dump($page->map);
  $rendered_map = $map_module->render($page, 'map');
  return "<div class='sf_map'>$rendered_map</div>";
}

that means, I just set the map address from $object with the members street, house number, zip and city. Such an address string is for example: "Rathausgasse 75, 3011 Bern".

This does not work, however. var_dump() shows the address I want, but the map ignores it. It uses instead the default address I saved in the field.

Edited by kongondo
mod note: please post module-related questions to the specific module's support board (if one exists)

Share this post


Link to post
Share on other sites

I found a solution. First I tried to save the field to the Processwire database, but this gave me the willies. It's a race, i. e. what if two people simultaneosly access this page?

After studying the source code of MapMarker I found the geocode() method.

This works now:

function getMap($object) {
  $map_module = wire('modules')->get('MarkupGoogleMap');
  $page = wire('page');
  $page->map->address = "{$object['strasse']} {$object['hausnummer']}, {$object['plz']} {$object['ort']}";
  $page->map->geocode();
  $rendered_map = $map_module->render($page, 'map');
  return "<div class='sf_map'>$rendered_map</div>";
}

Any thoughts?

Share this post


Link to post
Share on other sites
Hello to all,
since I switched to Processwire 3, I can no longer run the "Map Marker Module".
Attached 2 screenshots of what I see in the backoffice and the frontend.
Any thoughts on this?
 
Thank you very much for helping

post-2591-0-58503500-1459156687_thumb.pn

post-2591-0-72954500-1459156700_thumb.pn

Share this post


Link to post
Share on other sites

Hi, 

I'm having a similar issue. (Version 3.0.15 of processwire)

In the backend the google maps field loads fine (only when the field isn't hidden). But in the front-end I'm getting this:

maps.png

It's possible to drag, but the assets won't load (tiles, buttons). I have no clue why this is happening.

Share this post


Link to post
Share on other sites

Never mind,

There's something wrong with the css of semantic-ui. It's not an processwire / module issue.  :rolleyes:

Share this post


Link to post
Share on other sites

Map Marker Map is working smoothly with PW 2.7.2, thanks for all the support tips on this thread...

I want to display a kml file on the map along with my markers.

I've looked at the Google support:

https://developers.google.com/maps/documentation/javascript/examples/layer-kml

& tried adding code

var ctaLayer = new google.maps.KmlLayer({
            url: 'http://googlemaps.github.io/js-v2-samples/ggeoxml/cta.kml',
            map: RCDMap.map
          });

to RCDMap.js after line 47...But am struggling to get the kml to display.

Can anybody help with some any pointers? Thank you.

Share this post


Link to post
Share on other sites

bernhard, thanks for the super speedy reply  :) - you make it look so easy!

Was trying to integrate the code in with the Map Marker Javascript code (from earler in support thread).

I'll try & find the link...

Share this post


Link to post
Share on other sites

...looks like "RCDMap.js" is a verision of "MarkupGoogleMap.js" from the module (link).

Share this post


Link to post
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

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By anderson
      Hi all,
      I'm a new to website building. Learned some CRASH course of js,jquery,php. Then I found CMS. Still learning around forum, youtube....
      Anyway, please help me with some beginer questions:
      1, About template - please correct me if I understand wrong : every page should be (or recommended) built on a template. So if in total I'll have 10 pages, 2 of them have same layout, I'll need 9 templates.  And, what fields a page includes, is not defined in page, but defined in the template that page uses. 
      2,  Where to see what modules I've installed? is it in "Modules - Site"? 
      3, I installed "PageTable Extended", then what?  As in a youtube tutorial, it should appear in Setup tab, but it doesn't.  What's in there: templates,fields,logs,comments. (I installed "Uikit 3 site_blog profile".)
      4, I did a search in Processwire website for the famous "repeater matrix" module, and can not find it, there's a Repeater, as well as a Matrix. Is it not a module?
      5, I watched this youtube tuts: https://www.youtube.com/watch?v=IHqnLQy9R1A
      Anybody familiar with this tuts please help: 
      After he analysed a target webpage layout he wanted to mimic, he created some fields, some template, then based on those he created a page and input some "content" in there, then clicked "view", it's just some text. So, here comes my question, he copied a folder "assets" (subfolders are: css,fonts,js,img) over, then the page have the appearance/layout he wanted to mimic. Where does that assets folder come from?
      Appreciate any help.
    • By mtwebit
      I've created a set of modules for importing (manipulating and displaying) data from external resources. A key requirement was to handle large (100k+) number of pages easily.
      Main features
      import data from CSV and XML sources in the background (using Tasker) purge, update or overwrite existing pages using selectors user configurable input <-> field mappings on-the-fly data conversion and composition (e.g. joining CSV columns into a single field) download external resources (files, images) during import handle page references by any (even numeric) fields How it works
      You can upload CSV or XML files to DataSet pages and specify import rules in their description.
      The module imports the content of the file and creates/updates child pages automatically.
      How to use it
      Create a DataSet page that stores the source file. The file's description field specifies how the import should be done:
      After saving the DataSet page an import button should appear below the file description.

      When you start the import the DataSet module creates a task (executed by Tasker) that will import the data in the background.
      You can monitor its execution and check its logs for errors.

      See the module's wiki for more details.
      The module was already used in three projects to import and handle large XML and CSV datasets. It has some rough edges and I'm sure it needs improvement so comments are welcome.
    • By dreerr
      TemplateEnginePug (formally TemplateEngineJade)
       
      This module adds Pug templates to the TemplateEngineFactory. It uses https://github.com/pug-php/pug to render templates.
      doctype html html(lang='en') head meta(http-equiv='content-type', content='text/html; charset=utf-8') title= $page->title link(rel='stylesheet', type='text/css', href=$config->urls->templates . 'styles/main.css') body include header.pug h1= $page->title if $page->editable() p: a(href=$page->editURL) Edit Project on GitHub: github.com/dreerr/TemplateEnginePug
      Project in modules directory: modules.processwire.com/modules/template-engine-pug/
       
      For common problems/features/questions about the Factory, use the TemplateEngineFactory thread.
       
    • By Robin S
      Pages At Bottom
      Keeps selected pages at the bottom of their siblings.
      A "bottom page" will stay at the bottom even if it is drag-sorted to a different location or another page is drag-sorted below it (after Page List is refreshed the bottom page will still be at the bottom).
      Newly added sibling pages will not appear below a bottom page.
      The module also prevents the API methods $pages->sort() and $pages->insertAfter() from affecting the position of bottom pages.
      Note: the module only works when the sort setting for children on the parent page/template is "Manual drag-n-drop".
      Why?
      Because you want some pages to always be at the bottom of their siblings for one reason or another. And someone requested it. 🙂
      Usage
      Install the Pages At Bottom module.
      Select one or more pages to keep at the bottom of their siblings. If you select more than one bottom page per parent then their sort order in the page list will be the same as the sort order in the module config.

       
      https://github.com/Toutouwai/PagesAtBottom
      https://modules.processwire.com/modules/pages-at-bottom/
    • By Robin S
      Another little admin helper module...
      Template Field Widths
      Adds a "Field widths" field to Edit Template that allows you to quickly set the widths of inputfields in the template.

      Why?
      When setting up a new template or trying out different field layouts I find it a bit slow and tedious to have to open each field individually in a modal just to set the width. This module speeds up the process.
      Installation
      Install the Template Field Widths module.
      Config options
      You can set the default presentation of the "Field widths" field to collapsed or open. You can choose Name or Label as the primary identifier shown for the field. The unchosen alternative will become the title attribute shown on hover. You can choose to show the original field width next to the template context field width.  
      https://github.com/Toutouwai/TemplateFieldWidths
      https://modules.processwire.com/modules/template-field-widths/