service:Attr2Options source

Converts tag attributes to options used by google api v3 objects, map, marker, polygon, circle, etc.

Methods

filter (attrs) -> Hash

filters attributes by skipping angularjs methods $.. $$..

Parameters:
NameTypeDescription
attrs Hash

tag attributes

Returns:

filterd attributes

getControlOptions (filtered) -> Hash

control means map controls, i.e streetview, pan, etc, not a general control

Parameters:
NameTypeDescription
filtered Hash

filtered tag attributes

Returns:

Google Map options

getEvents (scope, attrs) -> Hash

converts attributes hash to scope-specific event function

Parameters:
NameTypeDescription
scope scope

angularjs scope

attrs Hash

tag attributes

Returns:

events converted events

getOptions (attrs, scope) -> Hash

converts attributes hash to Google Maps API v3 options

 . converts numbers to number   
 . converts class-like string to google maps instance   
   i.e. `LatLng(1,1)` to `new google.maps.LatLng(1,1)`  
 . converts constant-like string to google maps constant    
   i.e. `MapTypeId.HYBRID` to `google.maps.MapTypeId.HYBRID`   
   i.e. `HYBRID"` to `google.maps.MapTypeId.HYBRID`
Parameters:
NameTypeDescription
attrs Hash

tag attributes

scope scope

angularjs scope

Returns:

options converted attributess

orgAttributes (el) -> Hash

Returns the attributes of an element as hash

Parameters:
NameTypeDescription
el HTMLElement

html element

Returns:

attributes