Jump to content
KaMeKuN

Map Marker Fieldtype: lat lng problem with roadmap

Recommended Posts

Im having troubles to make this work; for some reason on the admin area i can set my market fine; but when i render the map y de frontend the marker just go difrent from i save.
 
I dont see why the module is making the marks  in drifrent location from save on the db.

Edit1: when i change the map to hybrid mode the market show in the right location; but if i switch to roadmap the cursor move from the location.
 

$markers = $page->children();
$map = $modules->get('MarkupGoogleMap');
print $map->render($markers, 'field_map', array('type' => 'ROADMAP'));

post-1401-0-55745400-1422317604_thumb.pn
 
post-1401-0-16949700-1422317602_thumb.pn
Edited by KaMeKuN

Share this post


Link to post
Share on other sites

How there is two markers?

The $markers = $page->children(); allow me to pass Page Array of markers.

im attaching the map on hybrid to see that works just fine in that type of map.

post-1401-0-05331800-1422396598_thumb.pn

Share this post


Link to post
Share on other sites

Since we're dealing with coordinates that don't change, it would guess that something is manipulating this at the CSS level so that the markers are getting offset. Especially if you are not seeing the same offset in the admin preview of your marker. The best bet may be to isolate and test it in an environment outside of any particular site (no other CSS or JS other than what comes with MapMarker and Google), and then slowly add your other files back to narrow in on what is causing the apparent 100-pixel (?) offset to the left. I'd also suggest trying another browser, just in case.

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 Sorina
      I've create a map with multiple markes. Now I'd like to show it in a reveal modal (foundation 6), can someone help me?
      I would like to display the google map in a modal reveal, to be visible only when I click on "Open google map".
      It seems that what I did does not work properly and I do not understand why.
      Look here: http://jsfiddle.net/x6nqL3po/1388/
    • By swampmusic
      Hi Folks,
      Encountered strange problem re: PageReference + MapMarker.
      The PageReference is being used for creating "tags" ala @renobird from this comment here: ( thx renobird! )
      I then have a template with the PageReference on it, then below that a simple and standard MapMarker.
      If i set the Page Reference to "Allow New Pages Created", it's great, new tags can be added in. But when you then tab into the MapMarker and set the location all appears fine until you either Save Page or Publish. At that point, the page is saved, the new tags are added correctly, but No Location is saved in the Map Marker.
      If I set the Page Reference to  NOT "Allow New Pages Created", the MapMarker location is saved perfectly well.
      So does anyone know if something weird happens in the "Save", that successfully adds in the new tags, but looses what was put into the MapMarker location ?
      Thx!
       
       
       
    • By hellomoto
      I have an importer function that goes like this so far
      function importCSV($filepath, $template, $parent_id = null, $grandparent_id = null) { $csv = array_map('str_getcsv', file($filepath)); array_walk($csv, function(&$a) use ($csv) { $a = array_combine($csv[0], $a); # set header keys }); array_shift($csv); # remove column header //echo '<pre>'; print_r($csv); echo '</pre>'; foreach($csv as $r) { $p = new Page(); $p->name = wire('sanitizer')->pageName($r['title']); $p->template = $template; if($parent_id !== 0||null) { $p->parent_id = $parent_id; } elseif($parent_id == 0||null) { //echo $r['parent'].' '; $parent = wire('sanitizer')->pageName($r['parent']); $parent = str_replace('---','-',$parent); //echo $parent.' ';//echo $grandparent_id.'gp '; $parent = wire('pages')->get('title=' . $r['parent'] . ', parent_id=' . $grandparent_id)->id; //echo $parent.'p '; $p->parent_id = $parent; unset($r['parent']); } $p->save(); var_dump($r); foreach($r as $k=>$v) { $fieldtype = wire('fields')->get('name='.$k)->type; echo $fieldtype.' '; if($fieldtype->name == 'FieldtypeImage') { $imgs = explode('|', $v); foreach($imgs as $i) { $p->$k = $i; } } elseif($fieldtype->name == 'FieldtypeMapMarker') { echo 'mapmarker'; $p->set($k->address, $v); } else $p->$k = $v; } $p->save(); echo '<br><br>'; } } Here is a sample row output:
      So it reads the field as being a MapMarker but does not input the address data as it's set to. Any clue as to why?
    • By dg234
      Hello all.  I hope it is OK to put this post here.  I am currently not a ProcessWire user but instead I am looking at switching from Concrete5 to ProcessWire and have a few questions.  
      My site contains information on hiking trails that is stored in number of related mySQL tables that are not part of the Concrete5 system. Each hike includes a detailed description, a map and a photo gallery with 20 or more images. The site uses a number of jQuery scripts for the photo gallery, trail ratings, a google map showing a gpx track and markers to display photos, etc. I am reading through the ProcessWire documentation but I am not seeing how I can easily recreate my site on ProcessWire. Could someone please point me in the right direction?
      Is it possible to link my tables to ProcessWire pages to display the information or does the data need to be moved into the processwire database?  Can you load and call jQuery scripts from a template? I understand that people have written a variety of modules but I do not see all the modules I need. If I can not load and call jQuery scripts in a template is it difficult to create a module? Is there documentation about creating modules? It looks like images need to be uploaded to your system. I literally have images for over 300 hikes with 20 or more images per hike. Uploading all these images would be an onerous process. Is it possible for templates within the ProcessWire script to use images outside the ProcessWire system? My guess is the answers to all these questions are obvious if I just know where to look.
      Thank you.
       
×
×
  • Create New...