-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Swift documentation #13
Comments
Its working for me:
|
Hello mahdigh99, |
@rakeshbethu Make sure you do these things:
I'm attaching my working project you can use it to understand better. (if it doesn't work in your computer just open the terminal and go to project directory and Run |
Thanks a lot mahi, This worked out really well. Very thanks for your quick turn around. |
Hello mahdigh99, |
Hi @mazharhameed25 ,
and for zoom in and & zoom out I think the best way is using scroll view,
but the alternative is :
|
thanks alot bro
…On Sat, Apr 27, 2019 at 7:33 PM mahdigh99 ***@***.***> wrote:
Hi mazharhameed,
I think the best way to show state names is adding state names to SVG
files.
you can change the color of the map by this code:
` var mapColors = UIColor
mapColors.append(UIColor(red:1.00, green:0.00, blue:0.00, alpha:1.0))
mapColors.append(UIColor(red:1.00, green:0.20, blue:0.00, alpha:1.0))
mapColors.append(UIColor(red:1.00, green:0.40, blue:0.00, alpha:1.0))
mapColors.append(UIColor(red:1.00, green:0.71, blue:0.00, alpha:1.0))
mapColors.append(UIColor(red:1.00, green:0.94, blue:0.00, alpha:1.0))
mapColors.append(UIColor(red:0.44, green:0.71, blue:0.00, alpha:1.0))
mapColors.append(UIColor(red:0.00, green:0.50, blue:0.00, alpha:1.0))
mapColors.reverse()
map.loadMap(mapName, withData:mapData, colorAxis:mapColors)`
and for zoom in and & zoom out I think the best way is using scroll view,
scrollView.minimumZoomScale = 1.0; scrollView.maximumZoomScale = 3.0
but the alternative is :
`
var previousScale:CGFloat = 1.0
override func viewDidLoad() {
super.viewDidLoad()
let gesture = UIPinchGestureRecognizer(target: self, action: #selector(pinchAction(sender:)))
self.view.addGestureRecognizer(gesture)
}
func pinchAction(sender:UIPinchGestureRecognizer) {
let scale:CGFloat = previousScale * sender.scale
self.view.transform = CGAffineTransform(scaleX: scale, y: scale);
previousScale = sender.scale
}
`
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#13 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AL5SV2L5LU5AZJIEZUQ7R6DPSRPZZANCNFSM4EKMK4EA>
.
|
bro i need your help. i want to switch on new controller on map clickable
area. how to get clickable state and move accordingly
On Mon, Apr 29, 2019 at 1:58 PM mazhar hameed <[email protected]>
wrote:
… thanks alot bro
On Sat, Apr 27, 2019 at 7:33 PM mahdigh99 ***@***.***>
wrote:
> Hi mazharhameed,
> I think the best way to show state names is adding state names to SVG
> files.
> you can change the color of the map by this code:
>
> ` var mapColors = UIColor
> mapColors.append(UIColor(red:1.00, green:0.00, blue:0.00, alpha:1.0))
> mapColors.append(UIColor(red:1.00, green:0.20, blue:0.00, alpha:1.0))
> mapColors.append(UIColor(red:1.00, green:0.40, blue:0.00, alpha:1.0))
> mapColors.append(UIColor(red:1.00, green:0.71, blue:0.00, alpha:1.0))
> mapColors.append(UIColor(red:1.00, green:0.94, blue:0.00, alpha:1.0))
> mapColors.append(UIColor(red:0.44, green:0.71, blue:0.00, alpha:1.0))
> mapColors.append(UIColor(red:0.00, green:0.50, blue:0.00, alpha:1.0))
>
> mapColors.reverse()
>
> map.loadMap(mapName, withData:mapData, colorAxis:mapColors)`
>
> and for zoom in and & zoom out I think the best way is using scroll view,
>
> scrollView.minimumZoomScale = 1.0; scrollView.maximumZoomScale = 3.0
>
> but the alternative is :
>
> `
> var previousScale:CGFloat = 1.0
>
> override func viewDidLoad() {
> super.viewDidLoad()
>
> let gesture = UIPinchGestureRecognizer(target: self, action: #selector(pinchAction(sender:)))
> self.view.addGestureRecognizer(gesture)
> }
>
> func pinchAction(sender:UIPinchGestureRecognizer) {
> let scale:CGFloat = previousScale * sender.scale
> self.view.transform = CGAffineTransform(scaleX: scale, y: scale);
>
> previousScale = sender.scale
> }
>
> `
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <#13 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AL5SV2L5LU5AZJIEZUQ7R6DPSRPZZANCNFSM4EKMK4EA>
> .
>
|
my map is not showing when i add state names on svg file
On Mon, Apr 29, 2019 at 3:39 PM mazhar hameed <[email protected]>
wrote:
… bro i need your help. i want to switch on new controller on map clickable
area. how to get clickable state and move accordingly
On Mon, Apr 29, 2019 at 1:58 PM mazhar hameed ***@***.***>
wrote:
> thanks alot bro
>
> On Sat, Apr 27, 2019 at 7:33 PM mahdigh99 ***@***.***>
> wrote:
>
>> Hi mazharhameed,
>> I think the best way to show state names is adding state names to SVG
>> files.
>> you can change the color of the map by this code:
>>
>> ` var mapColors = UIColor
>> mapColors.append(UIColor(red:1.00, green:0.00, blue:0.00, alpha:1.0))
>> mapColors.append(UIColor(red:1.00, green:0.20, blue:0.00, alpha:1.0))
>> mapColors.append(UIColor(red:1.00, green:0.40, blue:0.00, alpha:1.0))
>> mapColors.append(UIColor(red:1.00, green:0.71, blue:0.00, alpha:1.0))
>> mapColors.append(UIColor(red:1.00, green:0.94, blue:0.00, alpha:1.0))
>> mapColors.append(UIColor(red:0.44, green:0.71, blue:0.00, alpha:1.0))
>> mapColors.append(UIColor(red:0.00, green:0.50, blue:0.00, alpha:1.0))
>>
>> mapColors.reverse()
>>
>> map.loadMap(mapName, withData:mapData, colorAxis:mapColors)`
>>
>> and for zoom in and & zoom out I think the best way is using scroll view,
>>
>> scrollView.minimumZoomScale = 1.0; scrollView.maximumZoomScale = 3.0
>>
>> but the alternative is :
>>
>> `
>> var previousScale:CGFloat = 1.0
>>
>> override func viewDidLoad() {
>> super.viewDidLoad()
>>
>> let gesture = UIPinchGestureRecognizer(target: self, action: #selector(pinchAction(sender:)))
>> self.view.addGestureRecognizer(gesture)
>> }
>>
>> func pinchAction(sender:UIPinchGestureRecognizer) {
>> let scale:CGFloat = previousScale * sender.scale
>> self.view.transform = CGAffineTransform(scaleX: scale, y: scale);
>>
>> previousScale = sender.scale
>> }
>>
>> `
>>
>> —
>> You are receiving this because you commented.
>> Reply to this email directly, view it on GitHub
>> <#13 (comment)>,
>> or mute the thread
>> <https://github.com/notifications/unsubscribe-auth/AL5SV2L5LU5AZJIEZUQ7R6DPSRPZZANCNFSM4EKMK4EA>
>> .
>>
>
|
you can add this code to click event of each state to switch view controllers:
send me your SVG file to check it. |
bro. my map is not clickable when i zoom in
…On Wed, May 1, 2019 at 3:09 PM mahdigh99 ***@***.***> wrote:
area. how to get clickable state and move accordingly
you can add this code to click event of each state to switch view
controllers:
performSegueWithIdentifier("nextViewController", sender: self)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#13 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AL5SV2ICAIWRCHVJZSYHIDLPTFT5VANCNFSM4EKMK4EA>
.
|
I'm confused by the UIViewController, is there a way to add this to a view so I can get it to render a preview? |
in swift working with:
its working correctly but i cant add click Handler
how can i add click handler in Swift?
@ArthurGuibert @birslip
The text was updated successfully, but these errors were encountered: