airbnb / goji-js

React ❤️ Mini Program
https://goji.js.org
MIT License
224 stars 27 forks source link

Disable <map>'s setting usage temporary #103

Closed malash closed 3 years ago

malash commented 3 years ago

Why

These bad cases can reproduce the issue that empty setting field cause the map fails to render on iOS devices.

GojiJS ( v0.11.0 ):

import React from 'react';
import { render, Map } from '@goji/core';

render(<Map latitude={31.2253} longitude={121.45928} />);

Native WeChat Mini Program:

https://developers.weixin.qq.com/s/0e9NPsmd7fss

How

I thought several solutions, but non of them are 100% perfect to solve the issue.

  1. Set default value for setting, including these ways:
  1. Don't render setting="{{setting}}" field in map.wxml at all.

By now, I prefer to disable the usage of setting property to unblock white screen issue. And I will fix this bug later.

Ref

https://developers.weixin.qq.com/miniprogram/dev/component/map.html#setting