Enter a Search string - e.g. an address, place name or landmark. The item
has an onchange dynamic action that executes a JK64 Report Google Map R1 Action
set to Search map by Address.
When it is found, the map raises the addressFound event.
A dynamic action on the region then executes the following Actions:
- Execute JavaScript Code:
this.data.map.setCenter({lat:this.data.lat,lng:this.data.lng});
this.data.map.setZoom(17);
- Set Value, on item P5_ADDRESS, to JavaScript Expression:
this.data.result.formatted_address
- Set Value, on item P5_DSP_LAT_LNG, to JavaScript Expression:
this.data.lat + " " + this.data.lng);
Alternatively, if you click any point on the map, the mapClick
event fires and a dynamic action executes a JK64 Report Google Map R1 Action
set to Place Marker based on a JavaScript Expression:
{"lat":this.data.lat, "lng":this.data.lng}
Followed by another JK64 Report Google Map R1 Action set to
Get Address at Location based on the same JavaScript expression.
The maps "Draggable" option is set. This means the marker can be dragged to a new location; when this occurs, the markerDrag event fires and a
dynamic action calls Get Address at Location
again.
If the Region is selected, the search will bias the results to the selected region if multiple results are found.
If the Country is selected, the results will be restricted to the selected country.
When the Country is changed, a dynamic action performs three actions:
- Set Value - retrieves the lat,lng for the country into P5_LATLNG
- Javascript:
$("#map_mymap").reportmap("option","restrictCountry",$v("P5_COUNTRY"));
- JK64 Report Google Map R1 Action set to Pan To based on P5_LATLNG.