Skip to content

Commit

Permalink
Support for Marker Image URLs #20 - ATS note
Browse files Browse the repository at this point in the history
  • Loading branch information
EddyVerbruggen committed Nov 16, 2016
1 parent 24c149c commit bdfb9da
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ Check out the usage details on the functions below.
title: 'Nice location', // recommended to pass in
subtitle: 'Really really nice location', // one line is available on iOS, multiple on Android
icon: 'res://cool_marker', // use either this preferred way (to grab a density-independent marker from app resources), or:
icon: 'http(s)://my-remote-image', // an image from the interwebs, or:
icon: 'http(s)://my-remote-image', // an image from the interwebs (see the note at the bottom of this readme), or:
iconPath: 'res/markers/green_pin_marker.png', // anywhere in your app folder
onTap: function(marker) { console.log("This marker was tapped"); },
onCalloutTap: function(marker) { console.log("The callout of this marker was tapped"); }
Expand Down Expand Up @@ -232,7 +232,7 @@ You can update the map style after you've loaded it. How neat is that!?
title: 'One-line title here', // no popup unless set
subtitle: 'Infamous subtitle!',
icon: 'res://cool_marker', // preferred way, otherwise use:
icon: 'http(s)://website/coolimage.png', // from the internet, or:
icon: 'http(s)://website/coolimage.png', // from the internet (see the note at the bottom of this readme), or:
iconPath: 'res/markers/home_marker.png',
onTap: onTap,
onCalloutTap: onCalloutTap
Expand Down Expand Up @@ -559,3 +559,16 @@ Note that `hasFineLocationPermission` will return true when:
Note that the `show` function will also check for permission if you passed in `showUserLocation : true`.
If you didn't request permission before showing the map, and permission was needed, then
the location is not drawn on the map and the plugin will log an error to the console.
## Using marker images from the internet
If you specify `icon: 'http(s)://some-remote-image'`, then on iOS you'll need to whitelist
the domain. Google for iOS ATS for detailed options, but for a quick test you can add this to
`app/App_Resources/iOS/Info.plist`:
```xml
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
```

0 comments on commit bdfb9da

Please sign in to comment.