yandex-map-react
yandex-map-react copied to clipboard
Embedded user map
I guess that the most common potential use of the component is an embedded map on a company's contacts page. These maps are sometimes drawn as a user map and can be simply added as an overlay:
var ml = new YMaps.YMapsML('http://maps.yandex.ru/export/usermaps/xxx/');
map.addOverlay(ml);
It would be nice to have this functionality in the React version too:
<Map center={ [55.754734, 37.583314] } zoom={ 10 } >
<UserMapLayer id="xxx" onLoad={ this._userMapLoad } onLoadError={ this._userMapLoadError } />
</Map>
How difficult would this be to add? What alternatives to YMapsML exist in 2016? I might be pretty outdated about the way the things are done these days since I haven't been implementing anything YMaps-related for about 5 yrs. YMapsML seemed to be a good way of showing the driving directions to a company with no need to program the markers, the territories and the arrows manually.
Yes, it would be handy) "My maps" is closed in favour "Map constructor", that doesn't support export yet. But such functionality in plans. I'll ask about support of YMapsML as export format and other variants.
Got it. How would you recommend to display something like this on the map? https://yandex.github.io/mapsapi-examples-old/html/visualisationymapsml.html (this is from API v1 docs)
It does not have to be MapML per se, just wondering what else can substitute what I've already got.
It's possible, https://github.com/effrenus/yandex-map-react-examples/tree/usermap, but a little bit tricky)
In readme I've described the process.
Looks promising! I'll try it tonight.
It worked, many thanks! I'll keep the issue open just if you want to improve the link to the constructor. Feel free to close it if you don't have such plans – my problem is solved!
BTW there is still an issue with user maps / coordorder. If coordorder="longlat"
is not specified for the <Map />
, the user map becomes flipped. Mine moved from Penza to Kazakhstan :–)
↓
Yes, you are right. Default coordinate order is latlong
. But coordinates in constructor stored in longlat
order(