@tripian/react 9.0.28 → 9.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/GoogleMaps/GMarker/Base/helper.d.ts +1 -0
- package/index.js +22 -5
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -27247,7 +27247,7 @@ exports.default = questionContext;
|
|
|
27247
27247
|
"use strict";
|
|
27248
27248
|
|
|
27249
27249
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27250
|
-
exports.getOrderImage = exports.iconUrl = void 0;
|
|
27250
|
+
exports.createSvgIcon = exports.getOrderImage = exports.iconUrl = void 0;
|
|
27251
27251
|
var iconUrl = function (poiIcon, color, offer) {
|
|
27252
27252
|
if (poiIcon === void 0) { poiIcon = 'Flag'; }
|
|
27253
27253
|
if (color === void 0) { color = 'black2'; }
|
|
@@ -27256,6 +27256,13 @@ var iconUrl = function (poiIcon, color, offer) {
|
|
|
27256
27256
|
exports.iconUrl = iconUrl;
|
|
27257
27257
|
var getOrderImage = function (order) { return "https://s3-eu-west-1.amazonaws.com/poi-pics/Icon/order/marker-order-".concat(order, ".png"); };
|
|
27258
27258
|
exports.getOrderImage = getOrderImage;
|
|
27259
|
+
var createSvgIcon = function (number) {
|
|
27260
|
+
if (number > -1) {
|
|
27261
|
+
return "\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 256 256\" width=\"256\" height=\"256\">\n <circle cx=\"128\" cy=\"128\" r=\"75\" fill=\"#D6504A\" stroke=\"white\" stroke-width=\"15\" />\n <text x=\"128\" y=\"128\" font-size=\"100\" font-weight=\"bold\" text-anchor=\"middle\" fill=\"white\" font-family=\"Arial\" dy=\"0.35em\">".concat(number + 1, "</text>\n </svg>\n ");
|
|
27262
|
+
}
|
|
27263
|
+
return '';
|
|
27264
|
+
};
|
|
27265
|
+
exports.createSvgIcon = createSvgIcon;
|
|
27259
27266
|
|
|
27260
27267
|
|
|
27261
27268
|
/***/ }),
|
|
@@ -79081,12 +79088,22 @@ var react_1 = __importStar(__webpack_require__(0));
|
|
|
79081
79088
|
var api_1 = __webpack_require__(41);
|
|
79082
79089
|
var helper_1 = __webpack_require__(116);
|
|
79083
79090
|
var GMarkerOrderBase = function (_a) {
|
|
79091
|
+
// const markerIcon = useMemo(
|
|
79092
|
+
// () => ({
|
|
79093
|
+
// url: getOrderImage(order),
|
|
79094
|
+
// scaledSize: new google.maps.Size(18, 18),
|
|
79095
|
+
// anchor: new google.maps.Point(-2, 28),
|
|
79096
|
+
// }),
|
|
79097
|
+
// [order],
|
|
79098
|
+
// );
|
|
79084
79099
|
var coordinate = _a.coordinate, callbackMarkerClicked = _a.callbackMarkerClicked, title = _a.title, order = _a.order, animation = _a.animation;
|
|
79100
|
+
var svgIcon = (0, react_1.useMemo)(function () { return (0, helper_1.createSvgIcon)(order); }, [order]);
|
|
79101
|
+
var orderImageSvg = (0, react_1.useMemo)(function () { return "data:image/svg+xml;charset=UTF-8,".concat(encodeURIComponent(svgIcon)); }, [svgIcon]);
|
|
79085
79102
|
var markerIcon = (0, react_1.useMemo)(function () { return ({
|
|
79086
|
-
url:
|
|
79087
|
-
scaledSize: new google.maps.Size(
|
|
79088
|
-
anchor: new google.maps.Point(
|
|
79089
|
-
}); }, [
|
|
79103
|
+
url: orderImageSvg,
|
|
79104
|
+
scaledSize: new google.maps.Size(25, 25),
|
|
79105
|
+
anchor: new google.maps.Point(0, 28),
|
|
79106
|
+
}); }, [orderImageSvg]);
|
|
79090
79107
|
return (react_1.default.createElement(api_1.Marker, { position: coordinate, icon: markerIcon, onClick: callbackMarkerClicked,
|
|
79091
79108
|
/* label={{ text: (step.order + 1).toString(), fontSize: '13px', color: 'white' }} */
|
|
79092
79109
|
animation: animation, title: title }));
|