Documentations
Posted: 21 July 2010 06:05 AM   [ Ignore ]
Administrator
Avatar
RankRankRankRank
Total Posts:  108
Joined  2010-07-13

Features
- MSM compatible
- Based on Google Map API 3
- Support multi geo fields for entry
- Support multi markers per entry
- Drag and drop map marker point for precise control
- “Store locator” functionality


Requirements
PHP 5+
ExpressionEngine2

Installation
1. Download the latest version of MX Google Map and extract the .zip to your desktop.
2. Copy system/expressionengine/third_party/mx_google_map to system/expressionengine/third_party/mx_google_map
3. Copy themes/third_party/mx_google_map to themes/third_party/mx_google_map

Activation
  1.  Log into your control panel
  2. Browse to Addons → Fieldtypes
  3. Enable all the MX Google Map components

Todo
*markers list in slider bar with ordering option
*autofill slide bar field base on google map request
*Global settings
*Performance (php/js/cache optimization)
*Google maps for members custom fileds
*Directions support
*InfoWindows support


1.0.3 - * Search tags was change! Please check examples.

Version 1.0.4 download / bug tracker / future requests topic

 

Image Attachments
mx-google-map-field.png
 Signature 

my EE1 addons | @eecms
Like my addons? Buy me a coffee smile

Profile
 
 
Posted: 21 July 2010 06:07 AM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  108
Joined  2010-07-13

Default Icon Folder:

http://site.com/themes/third_party/mx_google_map/maps-icons/ 

Google Maps Icons collection

Display Map template

script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js">< /script>
script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false">< /script>
script type="text/javascript" src="/themes/third_party/mx_google_map/mxgooglemap.js">< /script>

{exp:channel:entries channel="my_channel" limit="1"}
{field_name
:map maptype="ROADMAP" mt_control_style "DROPDOWN_MENU" scrollwheel "false"
doubleclickzoomoff="true"}
{
/exp:channel:entries} 

Parameters

  * maptype ROADMAP
    The initial Map type
      • HYBRID This map type displays a transparent layer of major streets on satellite images.
      • ROADMAP This map type displays a normal street map.
      • SATELLITE This map type displays satellite images.
      • TERRAIN This map type displays maps with physical features such as terrain and vegetation.
  * n_control_style ZOOM_PAN
    The initial Navigation control style
      • SMALL displays a mini-zoom control, consisting of only + and - buttons. This style is appropriate for mobile devices.
      • ZOOM_PAN displays the standard zoom slider control with a panning control, as on Google Maps.
      • ANDROID displays the small zoom control as used on the native Maps application on Android devices.
      • DEFAULT picks an appropriate navigation control based on the map’s size and the device on which the map is running.
  * mt_control_style HORIZONTAL_BAR
    The initial MapType control style
      • HORIZONTAL_BAR displays the array of controls as buttons in a horizontal bar as is shown on Google Maps.
      • DROPDOWN_MENU displays a single button control allowing you to select the map type via a dropdown menu.
      • DEFAULT displays the “default” behavior, which depends on screen size and may change in future versions of the API
  * navigationControl true
    The initial enabled/disabled state of the navigation control.
  * scaleControl true
    The initial enabled/disabled state of the scale control.
  * mapTypeControl true
    The initial enabled/disabled state of the Map type control.
  * scrollwheel true
    If false, disables scrollwheel zooming on the map. The scrollwheel is enabled by default.
  * doubleclickzoomoff false
    Enables/disables zoom and center on double click. Enabled by default.
  * draggable true
    If false, prevents the map from being dragged. Dragging is enabled by default.
  * icon
    Custom Icons for marker without icons
  * marker_draggable false
    If false, prevents the makrer from being dragged.
  * width 500px
  * height 100%

Display Markers list template

{exp:channel:entries channel="about"}
<ul>
{gmap}<li>{latitude} {longitude}  {icon} {address} {city} {state} {zipcode}</li>{/gmap}
<ul>
{/exp:channel:entries} 

 

Image Attachments
mx-google-map-img-1.png
 Signature 

my EE1 addons | @eecms
Like my addons? Buy me a coffee smile

Profile
 
 
Posted: 21 July 2010 06:20 AM   [ Ignore ]   [ # 2 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  108
Joined  2010-07-13

Locator template:

Form (form.html)

{exp:mx_google_map:form result_page "/search.html" log="" lat="" unit "" backspace="1"}
<h2>Shop locator</h2>
<
p><label for="address">Enter street addresscity and/or zip</label>
<
input name="address" type="text" value="">


<
p><label for="radius">Select all points within</label>

<
select name="radius"><option value="100">100</option>
<
option value="50" selected="selected">50</option>
<
option value="30">30</option>
<
option value="25">25</option>
<
option value="20">20</option>
<
option value="15">15</option>
<
option value="10">10</option></select>
<
span>miles</span></p>
<
input type="submit" value="Submit" />

{/exp:mx_google_map:form} 

 

! For result ({exp:mx_google_map:search}) addon used channel class , so you can used all Channel tags inside {entries}{/entries} tags.


Results - list of points (search.html)

<h2>Results</h2>
<
ul>
{exp:mx_google_map:search channel="about" reverse_geocoding"true" address="" log="" lat="" unit "" radius "500" prec="2" prefix=""}
{entries}
<li><ul>
{field_name}<li>{title} #{point_id}-{distance}</li>{/field_name}
</ul>
</
li>{/entries}
{
/exp:mx_google_map:search}
</ul

Results - map (search.html)

script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></ script>
script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></ script>
script type="text/javascript" src="/themes/third_party/mx_google_map/mxgooglemap.js"></ script>
{exp:mx_google_map:search  channel="about" }
script type="text/javascript">
marker_icons_path "/themes/third_party/mx_google_map/maps-icons/";

$(
document).ready(function() 
   
$("#my_search_results").mxgoogleMaps({
 latitude
{center:lat},
 
longitude{center:long},
     
zoom:  10,
     
markers[{entries}{field_name}{marker_id {point_id},
      
state"{state}",
      
address"{address}",
      
city"{city}",
      
zipcode:  "{zipcode}",
      
latitude{latitude},
      
longitude{longitude},
      
draggablefalse,
      
icon"{icon}"},{/field_name}{/entries}]
     
,mapTypeIdgoogle.maps.MapTypeId.ROADMAP
     
,navigationControltrue
     
,scaleControltrue
     
,mapTypeControltrue
     
,mapTypeControlOptions{stylegoogle.maps.MapTypeControlStyle.DROPDOWN_MENU}
     
,scrollwheel:false
     
,disableDoubleClickZoom:true
    }
   
); 
   
  
}); 
< /
script>{/exp:mx_google_map:search}
<div style="height:600px;width:100%"><div id="my_search_results" style="width: 100%; height: 100%"></div></div

 

Searching with static parameters (Postal code as center of searching with radius 500 )

<ul>
{exp:mx_google_map:search channel="about" address="94105" radius "500" prec="2"}
{entries}
<li><ul>
{field_name}<li>{title} #{point_id}-{distance}</li>{/field_name}
</ul>
</
li>{/entries}
{
/exp:mx_google_map:search}
</ul

 

 Signature 

my EE1 addons | @eecms
Like my addons? Buy me a coffee smile

Profile
 
 
Posted: 25 July 2010 10:15 AM   [ Ignore ]   [ # 3 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  108
Joined  2010-07-13

Display more that 1 entry on the map

script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></ script>
script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></ script>
script type="text/javascript" src="/themes/third_party/mx_google_map/mxgooglemap.js"></ script>

script type="text/javascript">
marker_icons_path "/themes/third_party/mx_google_map/maps-icons/";

$(
document).ready(function() 
   
$("#my_full_map").mxgoogleMaps({
 latitude
{center:lat},
 
longitude{center:long},
     
zoom:  10,
     
markers[{exp:channel:entries channel="about" dynamic="off" backspace="1"}{field_name}{marker_id {point_id},
      
state"{state}",
      
address"{address}",
      
city"{city}",
      
zipcode:  "{zipcode}",
      
latitude{latitude},
      
longitude{longitude},
      
draggablefalse,
      
icon"{icon}"},{/field_name}{/exp:channel:entries}]
     
,mapTypeIdgoogle.maps.MapTypeId.ROADMAP
     
,navigationControltrue
     
,scaleControltrue
     
,mapTypeControltrue
     
,mapTypeControlOptions{stylegoogle.maps.MapTypeControlStyle.DROPDOWN_MENU}
     
,scrollwheel:false
     
,disableDoubleClickZoom:true
    }
   
); 
   
  
}); 
< /
script>{
<div style="height:600px;width:100%"><div id="my_full_map" style="width: 100%; height: 100%"></div></div
 Signature 

my EE1 addons | @eecms
Like my addons? Buy me a coffee smile

Profile
 
 
   
 
 
     Options for CP map ››