Skip to content

Commit

Permalink
Release V2.1.1 (#21)
Browse files Browse the repository at this point in the history
* Release V1.3.0

* Update README.md

* Update package.json

* Release V1.4.0 (#15)

* Search map updated, Marker changed

* 1.4.0 Release

* Lib updated

* Minor changes

(cherry picked from commit 89ec3ce)
(cherry picked from commit 0367cad)

* - marker position issue when map zoom in : Solved (#20)

- added *route* and *streetNumber* properties on AddressFormatter method

Co-authored-by: sandeep-r-bharatpe <61680562+sandeep-r-bharatpe@users.noreply.github.com>
  • Loading branch information
krishpe and sandeep-r-bharatpe authored Jul 7, 2020
1 parent 739cb61 commit 7136d64
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/index.modern.js

Large diffs are not rendered by default.

Binary file added example/images/search-map-filter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added example/images/search-map.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "g-mapify",
"version": "2.1.0",
"version": "2.1.1",
"description": "Flexible react google map with more options of search, pick & select.",
"author": "BharatPe TM",
"license": "ISC",
Expand Down
4 changes: 2 additions & 2 deletions src/Gmapify/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,6 @@ const GMapify = (props) => {
useEffect(() => {
if (mapInstance) {
setMapPosition(lat, lng);
addEvents();
addSearchBox();
addMarkers();
}
Expand All @@ -383,10 +382,11 @@ const GMapify = (props) => {
}, [addressInput]);

useEffect(() => {
addEvents();
return () => {
removeEvents();
};
}, []);
}, [mapLastPosition]);

return (
<div className={cx(styles.mapContainer, mapClassName)}>
Expand Down
10 changes: 10 additions & 0 deletions src/utils/addressFormatter_.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ const ADDRESS_TYPE_COUNTRY = "country";
const ADDRESS_TYPE_ADMIN_LEVEL_1 = "administrative_area_level_1";
const ADDRESS_TYPE_LOCALITY = "locality";
const ADDRESS_TYPE_SUB_LOCALITY = "sublocality";
const ADDRESS_TYPE_ROUTE = "route";
const ADDRESS_TYPE_PREMISE = "premise";
const ADDRESS_TYPE_STREET_NUMBER = "street_number";

/**
* @name formatter
Expand All @@ -23,6 +26,13 @@ const formatter = (components = [], currentPos = 0, returnObj = {}) => {
if (components.length > currentPos) {
for (const type of types) {
switch (type) {
case ADDRESS_TYPE_STREET_NUMBER:
case ADDRESS_TYPE_PREMISE:
returnObj.streetNumber = longName;
break;
case ADDRESS_TYPE_ROUTE:
returnObj.route = longName;
break;
case ADDRESS_TYPE_POSTAL_CODE:
returnObj.pin = longName;
break;
Expand Down

0 comments on commit 7136d64

Please sign in to comment.