Ankündigung

Einklappen
Keine Ankündigung bisher.

googlemap markers

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • googlemap markers

    Hello,

    I'm coming back to you again ;-)

    The links "more" of my elements lists are empty ... (see screen capture)

    I do not know why ??

    Thanks for your help

  • #2
    Project Link : http://www.cristal.prod-igweb.fr/nos...3%A9rents.html

    Kommentar


    • #3
      Du you have special characters in the url? Maybe JS don't like those
      http://www.premium-contao-themes.com

      Kommentar


      • #4
        It's exactly that !!
        thank you :-)

        Kommentar


        • #5
          I will come back to you for a new question.

          I noticed that the field "geolocation_street" does not accept all the special characters like for example "L'...."
          (See screenshot)

          If I write -> 6 Rue de ancienne mairie (it's good)
          If I write -> 6 Rue de l'ancienne mairie (google map no longer displayed)

          Is there a solution to work around the problem?

          Project link : https://cristal.prod-igweb.fr/nos-adherents.html

          thank you

          Kommentar


          • #6
            See the template customcatalog_googlemap_markers line 52. This is where the value is being placed. Google maps is a javascript function, you need to capsule any quoates or special characters there, otherwise JS will fail.
            http://www.premium-contao-themes.com

            Kommentar


            • #7
              Hello,

              Ok thank you for your response always responsive :-))

              Another question :
              Is it possible to have custom markers or different colors? (image icon for example)

              I created a new element in my custom elements (see print screen)

              But then I do not know what to change in the templates?

              You already do that?

              Project link : https://cristal.prod-igweb.fr/nos-adherents.html

              thank you

              Kommentar


              • #8
                The template is based on Googles Maps references. Line 115 creates a JS- Marker object. That's where you can define the styling of the marker.
                It all comes down to this: https://developers.google.com/maps/d...oid-sdk/marker

                There is also tons of material when you just ask google itself: https://stackoverflow.com/questions/...le-maps-marker
                http://www.premium-contao-themes.com

                Kommentar


                • #9
                  Hello,

                  Being more graphic than developer, this type of coding is out of my skills ...

                  What would be your price to do this development?

                  My need is the following:
                  - Can assign different markers for each customer record from the catalog.


                  Here is my template "customcatalog_googlemap_markers.html5":

                  PHP-Code:
                          <?php if($this->empty): ?>  <p class="info empty"><?php echo $this->empty?></p>  <?php return; endif;?>        <?php  global $objPage;  if(!$objPage->hasJQuery)  {  $GLOBALS['TL_JAVASCRIPT'][] = '//ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js';  }  /**   * To use google maps, please fill in your Google Maps API Key below   */  $GoogleMapsApiKey '';        /**   * DO NOT EDIT ANYTHING BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING!   */  if(strlen($GoogleMapsApiKey) < 1)  {  echo ($GLOBALS['TL_LANGUAGE'] == 'de' 'Google Maps API Schlüssel benötigt. Bitte tragen Sie den API Schlüssel im Template '.basename(__FILE__).' ein' 'Google Maps requires a valid API Key!');   return '';  }  ?>     <?php  $GLOBALS['TL_JAVASCRIPT'][] = '//maps.googleapis.com/maps/api/js?v=3.exp&key='.$GoogleMapsApiKey;      $arrLocations = array();   foreach($this->entries as $entry)  {  if($entry->field('geolocation')->value())  {  $strThumb str_replace('"','"',\Image::getHtml($entry->field('image')->generate(array(120,50))));  $strInfo '<h6>'.$entry->field('name')->value().'</h6>'.  '<p class="thumb">'.$strThumb.'</p>'.          '<p class="phone">Tél : '.$entry->field('phone')->value().'</p>'.          '<p class="email">Email : '.$entry->field('email')->value().'</p>'.  '<p class="more"><a href="'.$entry->links('detail')->url.'">'.$GLOBALS['TL_LANG']['MSC']['more'].'</a></p>';     $coords explode(','$entry->field('geolocation')->value());  $tmp = array  (  'coords'  => $entry->field('geolocation')->value(),  'latitude' => $coords[0],  'longitude' => $coords[1],  'city' => $entry->field('geolocation')->option('city'),  'street' => $entry->field('geolocation')->option('street'),  'country' => $entry->field('geolocation')->option('country'),  'zipcode' => $entry->field('geolocation')->option('zipcode'),  'link' => $entry->links('detail')->url,  'infotext' => $strInfo,  );            $arrLocations[] = $tmp;            }  }     $strLocations json_encode($arrLocations,JSON_HEX_QUOT);  ?>     <?php if(count($arrLocations) < 1): ?>  <p class="info"><?php echo $this->empty?></p>  <?php endif; ?>     <div class="<?php echo $this->class?> block" <?php echo $this->cssID?>>  <div id="map_<?php echo $this->id?>" class="gmap"></div>     <script type='text/javascript'>  /* <![CDATA[ */     /**  * Initialize the googlemap  */  function initializeMap_<?php echo $this->id?>() {     var map;  var center = {};  center.lat = 47.101683;  center.lng = 2.354007;     var mapOptions =   {  zoom: 6,  center: new google.maps.LatLng(center.lat,center.lng),  scrollwheel: false,  mapTypeId: google.maps.MapTypeId.ROADMAP  };     var map = new google.maps.Map(document.getElementById('map_<?php echo $this->id?>'),mapOptions);     var infowindow = new google.maps.InfoWindow();  var marker,i;     var locations = jQuery.parseJSON('<?php echo $strLocations?>');     for(i = 0; i < locations.length; i++)  {  var location = locations[i];  var pos = new google.maps.LatLng(location.latitude, location.longitude)  marker = new google.maps.Marker(  {  position: pos,  map: map,  title: '',  });     google.maps.event.addListener(marker, 'click', (function(marker,i)   {             return function()              {             infowindow.setContent(locations[i].infotext);     infowindow.open(map, marker);     }         })(marker,i));  }     }  google.maps.event.addDomListener(window, 'load',initializeMap_<?php echo $this->id?>);     /* ]]> */  </script>     </div


                  thank you
                  Zuletzt geändert von iGweb; 24.07.2018, 14:27.

                  Kommentar


                  • #10
                    I'm basically on vacation already. I'll be off until August 10th. Just place this quote in our job section.
                    http://www.premium-contao-themes.com

                    Kommentar

                    Lädt...
                    X